vmware / pyvmomi

VMware vSphere API Python Bindings
Apache License 2.0
2.2k stars 766 forks source link

Running Customize task on ESXi fails #312

Open derchrisuk opened 8 years ago

derchrisuk commented 8 years ago

I'm currently trying to add Clone support for a single ESXi. As the Clone task is not supported on ESXi, I'm deploying a OVF to the ESXi. After that I would run a customization to change IP/Hostname/DNS using Customize(spec=customspec) When I try to use the same vim.vm.ConfigSpec ,which works for normal deploy on a vCenter server, with a ESXi VM, it fails:

pyVmomi.VmomiSupport.NotSupported: (vmodl.fault.NotSupported) {
   dynamicType = <unset>,
   dynamicProperty = (vmodl.DynamicProperty) [],
   msg = 'The operation is not supported on the object.',
   faultCause = <unset>,
   faultMessage = (vmodl.LocalizableMessage) []
}

Is there a way around it?

derchrisuk commented 8 years ago

This is showing in the hostd.log on the ESXi

2015-11-19T14:42:13.751Z [41381B70 info 'Vimsvc.TaskManager' opID=hostd-b264 user=root] Task Created : haTask-50-vim.VirtualMachine.customize-382785687
2015-11-19T14:42:13.752Z [41981B70 info 'Default' opID=hostd-b264 user=root] AdapterServer caught exception: vmodl.fault.NotSupported
2015-11-19T14:42:13.752Z [41981B70 info 'Vimsvc.TaskManager' opID=hostd-b264 user=root] Task Completed : haTask-50-vim.VirtualMachine.customize-382785687 Status error
derchrisuk commented 8 years ago

Just saw there is an error on the initial post. vim.vm.ConfigSpec() does work. What is not working is vim.vm.customization.Specification()

My templates have no NIC, so I need to customize this during the deploy. Works ok with vCenter, just not with single ESXi

habakook commented 7 years ago

@derchrisuk , i am trying to use this code and get the same error as you did: https://github.com/rreubenur/vmware-pyvmomi-examples/blob/master/network_configure.py

I've replace vim.vm.customization.Specification() with vim.vm.ConfigSpec() as you suggested (line 109), but now I am getting different error (identity is not an attribute for ConfigSpec) Would you have any suggestions?