I can't seem to find a method in the SDK / get-view to disable the vapp options of a VM that was imported via OVF/OVA.
The GUI method is Select a VM -> edit settings -> options -> vapp options -> disable.
Anyone know of such a method?
Ryan
Here ya go:
#Use this to disable the vApp functionality.
$disablespec = New-Object VMware.Vim.VirtualMachineConfigSpec
$disablespec.vAppConfigRemoved = $True
#Use this to enable
$enablespec = New-Object VMware.Vim.VirtualMachineConfigSpec
$enablespec.vAppConfig = New-Object VMware.Vim.VmConfigSpec
#Get the VM you want to work against.
$VM = Get-VM NameofVM | Get-View
#Disables vApp Options
$VM.ReconfigVM($disablespec)
#Enables vApp Options
$VM.ReconfigVM($enablespec)
Here ya go:
#Use this to disable the vApp functionality.
$disablespec = New-Object VMware.Vim.VirtualMachineConfigSpec
$disablespec.vAppConfigRemoved = $True
#Use this to enable
$enablespec = New-Object VMware.Vim.VirtualMachineConfigSpec
$enablespec.vAppConfig = New-Object VMware.Vim.VmConfigSpec
#Get the VM you want to work against.
$VM = Get-VM NameofVM | Get-View
#Disables vApp Options
$VM.ReconfigVM($disablespec)
#Enables vApp Options
$VM.ReconfigVM($enablespec)
Thanks,
Per chance you can point me towards documentation which would have pointed me torwards this solution?
Regards,
Ryan
Great Cheat Tool:
Project Onyx: http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/onyx?rct=j&q=project%252...
Otherwise, lots of trial and error looking up in vSphere API Reference.
