os-resetState is not designed to be smart[1]. It simply writes the requested state to the DB but it does not do any validation or trigger any change of the VM itself. It is a last resort tool for the admin to
* push an VM from a stuck state to ERROR and the trigger a rebuild to recover it
* fix a db inconsistency where the VM is clearly and happily running but the DB state does not reflect that.
There are many cases when pushing a VM state to ACTIVE while it is not really running causes inconsistencies.
I don't think we want to make os-resetState smarter. But a fat warning should be added to the API reference.
os-resetState is not designed to be smart[1]. It simply writes the requested state to the DB but it does not do any validation or trigger any change of the VM itself. It is a last resort tool for the admin to
* push an VM from a stuck state to ERROR and the trigger a rebuild to recover it
* fix a db inconsistency where the VM is clearly and happily running but the DB state does not reflect that.
There are many cases when pushing a VM state to ACTIVE while it is not really running causes inconsistencies.
I don't think we want to make os-resetState smarter. But a fat warning should be added to the API reference.
[1] https:/ /github. com/openstack/ nova/blob/ 87d05fbae28d3dd 29de8a7c98cf26e 3f06648879/ nova/api/ openstack/ compute/ admin_actions. py#L63- L79