vmware-archive / rvc

RVC is a Linux console UI for vSphere, built on the RbVmomi bindings to the vSphere API.
MIT License
240 stars 48 forks source link

vm.add_disk - errors on 'key' #37

Closed nealjw1 closed 13 years ago

nealjw1 commented 13 years ago

I am running into issues running the vm.add_disk command. The command works correctly in our lab environment; however, when we run it in our production environment we get the following error. I am not sure why it is unable to locate the key in this environment. Any help would be greatly appreciated with this issue.

Please let me know if I can provide any more details about our environment to assist in troubleshooting this issue

/virtualcenter> vm.add_disk /virtualcenter/PP/vm/koanrbv2 --size 5G NoMethodError: undefined method key' for nil:NilClass /usr/lib64/ruby/gems/1.8/gems/rvc-1.5.0/lib/rvc/modules/vm.rb:645:inadd_disk' /usr/lib64/ruby/gems/1.8/gems/rvc-1.5.0/lib/rvc/modules/vm.rb:645:in select' /usr/lib64/ruby/gems/1.8/gems/rvc-1.5.0/lib/rvc/modules/vm.rb:645:inadd_disk' /usr/lib64/ruby/gems/1.8/gems/rvc-1.5.0/lib/rvc/shell.rb:108:in send' /usr/lib64/ruby/gems/1.8/gems/rvc-1.5.0/lib/rvc/shell.rb:108:ineval_command' /usr/lib64/ruby/gems/1.8/gems/rvc-1.5.0/lib/rvc/shell.rb:57:in eval_input' /usr/lib64/ruby/gems/1.8/gems/rvc-1.5.0/bin/rvc:144 /usr/bin/rvc:19:inload' /usr/bin/rvc:19 /virtualcenter>

nealjw1 commented 13 years ago

Well, I tested some different scenarios today and it appears this is related to the "Guest Operating System" option selected when creating a new VM. Anytime that I select "Red Hat Enterprise Linux 6 xxxxxxxx" under Linux group as the "Guest Operating System" and then attempt to run vm.add_disk on the newly provisioned VM it fails with the error listed above. In our lab environment we do not have the RHEL 6 option available and why I was not seeing that issues in our lab environment.

This is true even if you are trying to run vm.add_disk on any system that has been cloned from a VM or template provisioned with "Guest Operating System" set to "Red Hat Enterprise Linux 6 xxxxxxxx".

We are currently building a RHEL 6 servers with "Red Hat Enterprise Linux 5 xxxxxxxx" as the VMWare "Guest Operating System" until this issue has been resolved.

rlane commented 13 years ago

I'm guessing the VM doesn't have a VirtualLsiLogicController which is what vm.add_disk attaches the disk to. Can you run vm.devices against the RHEL6 VM so we can see what controllers are available?

nealjw1 commented 13 years ago

Yea, I think you are right. It looks like the "Red Hat Enterprise Linux 6 xxxx" Guest Operating System selection creates the scsi controller as ParaVirtualSCSIController type rather than LSI Logical Parallel for the hard drive to use. I validated that if I changed the type to LSI Logical Parallel that it works fine. We would like to use the paravirtual SCSI controller type as it does have some performance advantages (http://communities.vmware.com/docs/DOC-10971).

Are there any plans to add support for that ParaVirtualSCSIController type?

PRIOR TO CHANGING SCSI CONTROLLER TYPE: /virtualcenter> vm.devices /virtualcenter/PP/vm/ServerTeamLin/koanrbv2 IDE 0 (VirtualIDEController): IDE 0; IDE 1 (VirtualIDEController): IDE 1; PS2 controller 0 (VirtualPS2Controller): PS2 controller 0; PCI controller 0 (VirtualPCIController): PCI controller 0; SIO controller 0 (VirtualSIOController): SIO controller 0; Keyboard (VirtualKeyboard): Keyboard; Pointing device (VirtualPointingDevice): Pointing device; Device; Video card (VirtualMachineVideoCard): Video card; VMCI device (VirtualMachineVMCIDevice): Device on the virtual machine PCI bus that provides support for the virtual machine communication interface; SCSI controller 0 (ParaVirtualSCSIController): VMware paravirtual SCSI; Hard disk 1 (VirtualDisk): 16,777,216 KB; CD/DVD Drive 1 (VirtualCdrom): Remote device; disconnected Network adapter 1 (VirtualVmxnet3): VLAN131; disconnected Floppy drive 1 (VirtualFloppy): Remote; disconnected

Thanks for the assistance on this issue rlane.

rlane commented 13 years ago

I've reworked the virtual device commands and this is now supported. The commands have moved to the new "device" module, and the virtual devices now appear in the filesystem under vm_name/devices/. You can pass the --controller option to device.add_disk to select which IDE or SCSI controller to use.

nealjw1 commented 13 years ago

Awesome ... thanks.