Fail to run "viocli prepare datastore" with an error "TypeError: has_snapshot() takes exactly 2 arguments (1 given))
book
Article ID: 337215
calendar_today
Updated On:
Products
VMwareVMware Integrated OpenStack
Issue/Introduction
Symptoms: In trying to run "viocli prepare datastore", you can see similar outputs to:
# viocli prepare datastore dc-name ds-name -v 2020/08/04 09:39:38 failed executing the command with error command terminated with exit code 1: Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/lib/python2.7/site-packages/viocli/bundle/dsmigrateprep.py", line 181, in ds_migrate_prep if has_snapshot(uuid): TypeError: has_snapshot() takes exactly 2 arguments (1 given)
Environment
VMware Integrated OpenStack 6.x
Cause
This issue is caused because an argument of "has_snapshot()" function in dsmigrateprep.py is one.
Resolution
This is a known issue in VMware Integrated OpenStack 6.x. It is resolved in VMware Integrated OpenStack 7.0 and newer.
Workaround: 1. login to vioshim pod by running: "osctl exec -it <vioshim-pod-name> bash 2. change /usr/lib/python2.7/site-packages/viocli/bundle/dsmigrateprep.py", line 181 to: if has_snapshot(uuid, os_config.cs): 3. add these 2 lines after line#141: os_config = OSConfiguration() os_config.authenticate(DEFAULT_OS_VOLUME_API_VERSION) 4. try ds prepare cmd again.