Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleted flavors break VM resize and Horizon UI #574

Closed
okozachenko1203 opened this issue Sep 8, 2023 · 6 comments
Closed

Deleted flavors break VM resize and Horizon UI #574

okozachenko1203 opened this issue Sep 8, 2023 · 6 comments
Assignees

Comments

@okozachenko1203
Copy link
Member

okozachenko1203 commented Sep 8, 2023

Context

A VM created using one flavor, then that flavor deleted somehow. Now this non-existing flavor produces 2 issues

  • Horizon admin UI outputs the same number of error messages (like Error: Unable to retrieve instance size information. [Details] Flavor xxx could not be found. (HTTP 404)) as the instance number in the VM table
  • VM resize doesn't work for those VMs created by using this deleted flavor
  root@ostack-controller-01:~# openstack server stop 16a2f715-f7ce-45f9-ac8d-f3072791f624
root@ostack-controller-01:~# openstack server resize --flavor 3846abe4-7d9f-4506-92a4-e0ccfce573dc 16a2f715-f7ce-45f9-ac8d-f3072791f624
root@ostack-controller-01:~# openstack server resize confirm 16a2f715-f7ce-45f9-ac8d-f3072791f624
Cannot 'confirmResize' instance 16a2f715-f7ce-45f9-ac8d-f3072791f624 while it is in vm_state stopped (HTTP 409) (Request-ID: req-598fc277-6b9f-403b-9607-b104867c1155)
root@ostack-controller-01:~# openstack server start 16a2f715-f7ce-45f9-ac8d-f3072791f624
root@ostack-controller-01:~# openstack server resize confirm 16a2f715-f7ce-45f9-ac8d-f3072791f624
Cannot 'confirmResize' instance 16a2f715-f7ce-45f9-ac8d-f3072791f624 while it is in vm_state active (HTTP 409) (Request-ID: req-ebf19636-1dfb-4f02-90a9-11cc879ea4af)

How to reproduce

  1. Create a VM using an existing flavor
  2. Delete that flavor
  3. Try resize or visit Horizon UI admin panel to get the VM list

Solutions

  • Disallow the flavor deletion if there is a VM using that flavor at least (changes required in nova)
  • Or allow the flavor deletion regardless of its usage as is. And add exception handling in horizon and nova side.(But need to check first if old flavor is required in the resize process for some reason) (changes required in horizon and nova)
@okozachenko1203 okozachenko1203 self-assigned this Oct 13, 2023
@mnaser
Copy link
Member

mnaser commented Oct 18, 2023

@okozachenko1203 i believe that the flavor is embedded in the database, so it should be able to get whatever info it needs.

also, when the resize is failing, can you get some logs from nova-compute?

@okozachenko1203
Copy link
Member Author

I can reproduce this in my devstack. When i access admin>compute>instances dashboard
image

Oct 24 08:53:37 mcapi devstack@n-api.service[126478]: [pid: 126478|app: 0|req: 1782/7124] 38.108.68.23 () {60 vars in 1214 bytes} [Tue Oct 24 08:53:37 2023] GET /compute/v2.1/flavors/3 => generated 74 bytes in 14 msecs (HTTP/1.1 404) 9 headers in 378 bytes (1 switches on core 0)
Oct 24 08:53:37 mcapi devstack@n-api.service[126477]: DEBUG nova.api.openstack.wsgi [None req-ebdbae27-ecd3-4378-bfb8-a0026794c0ef demo admin] Calling method '<bound method FlavorsController.show of <nova.api.openstack.compute.flavors.FlavorsController object at 0x7f55b9692680>>' {{(pid=126477) _process_stack /opt/stack/nova/nova/api/openstack/wsgi.py:513}}
Oct 24 08:53:37 mcapi devstack@n-api.service[126477]: INFO nova.api.openstack.wsgi [None req-ebdbae27-ecd3-4378-bfb8-a0026794c0ef demo admin] HTTP exception thrown: Flavor 3 could not be found.
Oct 24 08:53:37 mcapi devstack@n-api.service[126477]: DEBUG nova.api.openstack.wsgi [None req-ebdbae27-ecd3-4378-bfb8-a0026794c0ef demo admin] Returning 404 to user: Flavor 3 could not be found. {{(pid=126477) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:936}}

@okozachenko1203
Copy link
Member Author

but i was able to resize the instance which was created using the flavor deleted

@mnaser
Copy link
Member

mnaser commented Oct 31, 2023

@mnaser
Copy link
Member

mnaser commented Oct 31, 2023

I've pushed up a fix here..

https://review.opendev.org/c/openstack/horizon/+/899752

@ricolin @okozachenko1203 can we help track this down and perhaps cherry-pick into our horizon image?

@mnaser
Copy link
Member

mnaser commented Nov 30, 2023

this is already fixed

@mnaser mnaser closed this as completed Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants