I am trying to set the operating system type of a virtual machine shell using the Perl version 5 SDK and am receiving an error.
Snippet of code:
$guestid = "sles11_64Guest"
my $guestid = VirtualMachineConfigInfo->new(guestId => $guestid);
my $spec = VirtualMachineConfigSpec->new(guestId => $guestid);
my $task = $vm_view->ReconfigVM_Task(spec => $spec);
The error that is returned is as follows:
String: An error occurred during host configuration.
Detail: PlatformConfigFault
Any assistance that can be provided would be greatly appreciated.
Thanks.
Hi,
You had it right at $spec, if you take a look at the vSphere API Ref - http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc_50%2Fvim.vm.ConfigS...
ReconfigVM_Task() takes in spec property which is a VirtualMachineConfigSpec and that has a property called guestId which is just a string.
So you should have the following:
$guestid = "sles11_64Guest"
my $spec = VirtualMachineConfigSpec->new(guestId => $guestid);
my $task = $vm_view->ReconfigVM_Task(spec => $spec);
Hi,
You had it right at $spec, if you take a look at the vSphere API Ref - http://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.apiref.doc_50%2Fvim.vm.ConfigS...
ReconfigVM_Task() takes in spec property which is a VirtualMachineConfigSpec and that has a property called guestId which is just a string.
So you should have the following:
$guestid = "sles11_64Guest"
my $spec = VirtualMachineConfigSpec->new(guestId => $guestid);
my $task = $vm_view->ReconfigVM_Task(spec => $spec);
That did the trick. Thanks!