I assume you deployment does not use positive shelved_offload_time value in the config. So the shelve command puts is in SHELVED_OFFLOADED state immediately. That means instance.host will be None and therefore nova-api will do a local delete [1]. The soft delete codepath would to a call down to the compute to stop the VM but without instance.host pointing to any host that is not done. This is why the instance got fully deleted if it is in SHELVED_OFFLOADED state before the delete.
Base on the code structure I don't think nova ever considered soft deleting a SHELVED_OFFLOADED VMs. I'm not sure we can change this behavior as a bugfix as users might already depend on the current behavior. So this needs to be handled as a new feature. [2]
I assume you deployment does not use positive shelved_ offload_ time value in the config. So the shelve command puts is in SHELVED_OFFLOADED state immediately. That means instance.host will be None and therefore nova-api will do a local delete [1]. The soft delete codepath would to a call down to the compute to stop the VM but without instance.host pointing to any host that is not done. This is why the instance got fully deleted if it is in SHELVED_OFFLOADED state before the delete.
Base on the code structure I don't think nova ever considered soft deleting a SHELVED_OFFLOADED VMs. I'm not sure we can change this behavior as a bugfix as users might already depend on the current behavior. So this needs to be handled as a new feature. [2]
[1] https:/ /github. com/openstack/ nova/blob/ edaaa97d9911b84 9f3b5731746274b 44a08ce14c/ nova/compute/ api.py# L2440 /docs.openstack .org/nova/ latest/ contributor/ process. html#how- do-i-get- my-code- merged
[2] https:/