-
Notifications
You must be signed in to change notification settings - Fork 1
Description
I am using the following command to convert my vm to AMI. I am facing below error. Even though the VM is in powered off state it says "The operation is not allowed in the current state." What does this mean?
vm2ami -i 'vcenter-ip' -u 'user' -p 'password' -n 'vm-name' -r 'region' -a 'default' -d 'directory-name' -b 'bucket-name' -m 'AMI-name'
Checking for s3 bucket
Attempting ec2 import dry run: aws ec2 import-image --dry-run --profile default --region us-west-2
Dry run operation successful!
Logged into xxxxx as xxxxx
Found virtual machine: xxxx
Working dir: xxxx
Target dir:xxxxx/503cd54a-c41b-04c2-e0f0-aedafede8602
HTTP NFC Lease Initializing.
Getting OVF Manager
Creating OVF Descriptor
Writing OVF Descriptor xxxxxxx/503cd54a-c41b-04c2-e0f0-aedafede8602/rxxxxxovf
Getting OVF Manager
Creating OVF Descriptor
Writing OVF Descriptor xxxxx/503cd54a-c41b-04c2-e0f0-aedafede8602/rxxxxx.ovf
Traceback (most recent call last):
File "/usr/bin/vm2ami", line 3, in
vm2ami.main()
File "/usr/lib/python2.7/site-packages/vm2ami/vm2ami.py", line 41, in main
downloaded_vmdk = ovfexport.convert(args)
File "/usr/lib/python2.7/site-packages/ovfexporter/ovfexport.py", line 50, in convert
return exporter.export_ovf()
File "/usr/lib/python2.7/site-packages/ovfexporter/OvfExporter.py", line 327, in export_ovf
http_nfc_lease.HttpNfcLeaseComplete()
File "/usr/lib/python2.7/site-packages/pyVmomi/VmomiSupport.py", line 706, in
self.f(*(self.args + (obj,) + args), **kwargs)
File "/usr/lib/python2.7/site-packages/pyVmomi/VmomiSupport.py", line 512, in _InvokeMethod
return self._stub.InvokeMethod(self, info, args)
File "/usr/lib/python2.7/site-packages/pyVmomi/SoapAdapter.py", line 1397, in InvokeMethod
raise obj # pylint: disable-msg=E0702
pyVmomi.VmomiSupport.InvalidState: (vim.fault.InvalidState) {
dynamicType = ,
dynamicProperty = (vmodl.DynamicProperty) [],
msg = 'The operation is not allowed in the current state.',
faultCause = ,
faultMessage = (vmodl.LocalizableMessage) []
}