I tried using the vdiskcreate.pl (with the changes suggested in other discussions) and was able to create and add disks to the Virtual machine.However,
I could do so only for 7 disks, after that I keep getting an "Invalid Disk backing Info Specified" error.
Unable to configure virtual device.[tatavv@rtatavarty-dl vmware-vsphere-cli-distrib]$ /usr/lib/vmware-vcli/apps/vm/vdiskcreate.pl --disksize 10000 --filename test_vm_7.vmdk --vmname test_vm --backingtype regular
Adding Virtual Disk on Virtual machine ddve-5.3.0.0-287143 in the host hpc12-bl7.datadomain.com
Invalid Disk Backing Info SpecifiedFalut : Cannot serialize deviceChange as VirtualDeviceConfigSpec at /usr/lib/perl5/5.8.6/VMware/VICommon.pm line 2109
ComplexType::serialize('VirtualMachineConfigSpec=HASH(0x5bbbb40)', 'spec') called at /usr/lib/perl5/5.8.6/VMware/VIM25Stub.pm line 48718
VimService::get_arg_string('VirtualMachineConfigSpec=HASH(0x5bbbb40)', 'spec', 'VirtualMachineConfigSpec') called at /usr/lib/perl5/5.8.6/VMware/VIM25Stub.pm line 48739
VimService::build_arg_string('ARRAY(0x50241c0)', 'HASH(0x5024140)') called at /usr/lib/perl5/5.8.6/VMware/VIM25Stub.pm line 50722
VimService::ReconfigVM_Task('VimService=HASH(0xee1a70)', '_this', 'ManagedObjectReference=HASH(0x2aaaaef5f3e0)', 'spec', 'VirtualMachineConfigSpec=HASH(0x5bbbb40)') called at /usr/lib/perl5/5.8.6/VMware/VICommon.pm line 1449
ViewBase::invoke('VirtualMachine=HASH(0x1e2e020)', 'ReconfigVM_Task', 'spec', 'VirtualMachineConfigSpec=HASH(0x5bbbb40)') called at /usr/lib/perl5/5.8.6/VMware/VIM25Runtime.pm line 2519
VirtualMachineOperations::ReconfigVM_Task('VirtualMachine=HASH(0x1e2e020)', 'spec', 'VirtualMachineConfigSpec=HASH(0x5bbbb40)') called at /usr/lib/perl5/5.8.6/VMware/VIM25Runtime.pm line 2525
VirtualMachineOperations::ReconfigVM('VirtualMachine=HASH(0x1e2e020)', 'spec', 'VirtualMachineConfigSpec=HASH(0x5bbbb40)') called at /usr/lib/vmware-vcli/apps/vm/..//AppUtil/VMUtil.pm line 506
eval {...} called at /usr/lib/vmware-vcli/apps/vm/..//AppUtil/VMUtil.pm line 505
VMUtils::add_virtualdisk('vm', 'VirtualMachine=HASH(0x1e2e020)', 'devspec', 'undef') called at /usr/lib/vmware-vcli/apps/vm/vdiskcreate.pl line 104
main::create_virtualdisk() called at /usr/lib/vmware-vcli/apps/vm/vdiskcreate.pl line 58
I tried doing the same with another VM and was able to add exactly 7 disks but not more than that. Is there any fix for this? I was able add more disks using GUI without any issues. This script is very useful and will be much useful if it can be used for more disks. Please give any helpful pointers to resolve this issue. I tried and got the same result with v4.0 and v5.0.
Thanks in advance
R
Further debugging this issue, looking for why only 7 disks are allowed for this function, I observed that
the scsi(0:7) was reserved for the adapter (http://communities.vmware.com/message/1904951).
Is it the bug in the script for the failure to add disk on index 8, which is 0:7?
If yes, is there any way to skip the 0:7 and move forward? Also, along the same lines, can the script
handle adding more than 15 disks, ie., when the index moves to SCSI(1:0)? I am perl-illeterate, so
someone with perl proficiency can comment - thanks!
R
Hi,
You can manually skip the index 8 and you can add script for scsi controller creation after the index 15.
Thanks,
Vijaya
Since there is not option to specify the SCSI index in the arg list, I modified the script to take one and update the index correctly.
Also, the selection criterion for the SCSi controller is incomplete in the VMUtil.pm as it only looks for LSILogicControllers, infact it should
also include the other types of controllers that could be added - which in my case is a ParaVirtualSCSI controller.
Thanks,
Ratnam
Hi,
Could you please upload your current using script..so that we can understand better.
Thanks,
Vijaya
Hi,
you need to modify the script:
my $controllerKey = $controller->key;
my $unitNumber = $#{$controller->device} + 1;
$unitNumber is the value for using to add disks. so that you can add script to check the value of $unitNumber and If its 7 then you can add one to that value and make the step to skip. $controllerKey value is the scsi controller value. you can use the value to create new scsi controller once the disk count exceed 15.
Thanks,
Vijaya
Hi
to solve the issue of not able to add more than 7 disk, add this
$unitNumber++ if ($unitNumber > 6);
just below
my $controllerKey = $controller->key;
my $unitNumber = $#{$controller->device} + 1;
in your vdiskcreate.pl file.
after making changes you will able to add more disk till 15 disks
thanks