0

I create a volume then I use it to create server. I would like to rebuild this server such that its image is changed. When I call nova rebuild api with a new image, it is said:

Image c1d9.... is unacceptable: Unable to rebuild with a different image for a volume-backed server

How can I rebuild volume-backend server?

Bani
  • 19
  • 6

1 Answers1

0

As noted in Openstack docs [1], rebuild is not supported for volume-based VMs.

Assuming you are trying to rebuild the VM with a fresh image ("factory reset"), a slightly "hacky" solution is to replace the underlying volume with the fresh image while keeping the same pool/path.

For Ceph based backend, it would be something like

openstack volume show <...> => Get pool/path from rbd backend
openstack image show <...> => Get pool/path from rbd backend
openstack server stop <VM> => Stop the VM

rbd -p <POOL NAME> mv <VM VOLUME UUID>  <VM VOLUME UUID>.old
rbd -p <POOL NAME> cp <IMAGE VOLUME UUID> <VM VOLUME UUID> 

Once the copy finishes, start the VM

openstack server start <VM>

https://docs.openstack.org/api-ref/compute/?expanded=rebuild-server-rebuild-action-detail#rebuild-server-rebuild-action

Otto
  • 106
  • 1