'openstack server migration show' command is broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openstacksdk |
Fix Released
|
Undecided
|
Bence Romsics |
Bug Description
First I noticed this:
$ openstack server create --flavor cirros256 --image cirros-
...
$ openstack server migrate vm0 --wait
...
$ openstack server migration list --server vm0
+----+-
| Id | UUID | Source Node | Dest Node | Source Compute | Dest Compute | Dest Host | Status | Server UUID | Old Flavor | New Flavor | Type | Created At | Updated At |
+----+-
| 1 | f6ab557c-4207-40c0- | devstack0a | devstack0 | devstack0a | devstack0 | 192.168.122.225 | error | 24e41ff4-741d-40d3- | 1 | 1 | migration | 2024-01- | 2024-01- |
| | 9924-69d434bf063a | | | | | | | a742-56229181a5ae | | | | 30T13:33:08.000000 | 30T13:33:10.000000 |
+----+-
$ openstack server migration show vm0 f6ab557c-
'server_uuid'
$ echo $?
1
Then I realized that the same happens even with a non-existent uuid:
$ openstack server migration show vm0 00000000-
'server_uuid'
$ echo $?
1
The environment is a recent master devstack with:
$ openstack --version
openstack 6.4.1
I plan to come back and fix this in the near future.
Changed in python-openstackclient: | |
assignee: | nobody → Bence Romsics (bence-romsics) |
I had some time to look into this and I found the root cause:
First of all here's traceback printed at debug level:
Traceback (most recent call last): data/venv/ lib/python3. 10/site- packages/ cliff/app. py", line 410, in run_subcommand parsed_ args) data/venv/ lib/python3. 10/site- packages/ osc_lib/ command/ command. py", line 38, in run parsed_ args) data/venv/ lib/python3. 10/site- packages/ cliff/display. py", line 117, in run action( parsed_ args) python- openstackclient /openstackclien t/compute/ v2/server_ migration. py", line 316, in take_action migration = _get_migration_ by_uuid( python- openstackclient /openstackclien t/compute/ v2/server_ migration. py", line 252, in _get_migration_ by_uuid client. server_ migrations( server_ id): openstacksdk/ openstack/ resource. py", line 2060, in list
File "/opt/stack/
result = cmd.run(
File "/opt/stack/
return super(Command, self).run(
File "/opt/stack/
column_names, data = self.take_
File "/opt/stack/
server_
File "/opt/stack/
for migration in compute_
File "/opt/stack/
uri = base_path % params
KeyError: 'server_uuid'
Please note that the traceback above is incomplete between _get_migration_ by_uuid( ) and list().
However it's quite clear that here we pass 'server_id': /opendev. org/openstack/ openstacksdk/ src/commit/ c2baf1db41cce65 ce1aa8ac8908c4e 0d98f7a94c/ openstack/ compute/ v2/_proxy. py#L2196
https:/
But when we fill in the base_path template here: /opendev. org/openstack/ openstacksdk/ src/commit/ c2baf1db41cce65 ce1aa8ac8908c4e 0d98f7a94c/ openstack/ resource. py#L2060
https:/
We expect 'server_uuid' instead of 'server_id': /opendev. org/openstack/ openstacksdk/ src/commit/ c2baf1db41cce65 ce1aa8ac8908c4e 0d98f7a94c/ openstack/ compute/ v2/server_ migration. py#L21
https:/
Both sides of the conflicting code were merged in: /review. opendev. org/c/openstack /openstacksdk/ +/815099
https:/
I suspect the source of the confusion may have been this: /review. opendev. org/c/openstack /openstacksdk/ +/815099/ 3/openstack/ compute/ v2/server_ migration. py#56
https:/
Since the root cause is in openstacksdk, I'm moving the ticket accordingly.