vmware / pyvmomi

VMware vSphere API Python Bindings
Apache License 2.0
2.21k stars 764 forks source link

pyvmomi v6.5.0.2017.5-1 , v7.0.3 and python 2.7 VirtualNVMEController is getting converted to VirtualController when device change spec is passed to esx host #976

Open niraja-k opened 2 years ago

niraja-k commented 2 years ago

I am trying to create vm having hard disk attached through nvme controller. When I pass vim.vm.ConfigSpec with deviceChange property setting to list of vim.vm.device.VirtualDeviceSpec having one for nvme controller - the spec is getting created but when it is passed to esx host it is getting internally converted to VirtualController object due to which Create_VMTask is failing with invalid device spec. I checked spec passed to host in hostd.log there its failing while adding disk (which is attached through this controller) with GetDiskControllerType: controller type unacceptable: (vim.vm.device.VirtualDisk) .

Sample spec created (vim.vm.device.VirtualDeviceSpec) { dynamicType = <unset>, dynamicProperty = (vmodl.DynamicProperty) [], operation = 'add', fileOperation = <unset>, device = (vim.vm.device.VirtualNVMEController) { dynamicType = <unset>, dynamicProperty = (vmodl.DynamicProperty) [], key = 31000, deviceInfo = (vim.Description) { dynamicType = <unset>, dynamicProperty = (vmodl.DynamicProperty) [], label = 'NVME controller 0', summary = 'NVME controller 0' }, backing = <unset>, connectable = <unset>, slotInfo = <unset>, controllerKey = 100, unitNumber = 31, busNumber = 0, device = (int) [ 32015 ] }, profile = (vim.vm.ProfileSpec) [], backing = <unset> },

spec logged in hostd.log (vim.vm.device.VirtualDeviceSpec) { --> operation = "add", --> device = (vim.vm.device.VirtualController) { --> key = 31000, --> deviceInfo = (vim.Description) { --> label = "NVME controller 0", --> summary = "NVME controller 0" --> }, --> busNumber = 0, --> }, --> },

Also when I am trying to retrieve managed object for this vm the vm_conf.hardware.device is not recognizing it as VirtualNVMEController but instead it is returning VirtualController. I have tried this using both pyvmomi versions - v6.5.0.2017.5-1 and v7.0.3

Please check if I have missed anything and any help will be highly appreciated. Let me know if need more information.