Change Openstack Instance’s Image

openstackopenstack-neutron

When creating an instance on openstack, it is automatically assigned an IP address on the subnet.

I have an instance that has a bad image. The network is configured for the given IP address.

Is there a way to change the image of an instance? I have tried rebuilding but the bad image is still there.

Thanks

I tried running the following:

nova --debug boot --flavor 17172145-c56e-4407-8f6b-5273fa19634d --image 41618691-aa09-4cf1-90ba-fdb4a742da87 --access-ip-v4 10.105.5.81 --access-ip-v6 10.105.5.81 --security-groups http_access TestingBoot

To get the following error messages returned:

DEBUG (shell:984) Not found (HTTP 404)
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/novaclient/shell.py", line 982, in main
OpenStackComputeShell().main(argv)
File "/usr/lib/python2.7/site-packages/novaclient/shell.py", line 909, in main
args.func(self.cs, args)
File "/usr/lib/python2.7/site-packages/novaclient/v2/shell.py", line 686, in do_boot
boot_args, boot_kwargs = _boot(cs, args)
File "/usr/lib/python2.7/site-packages/novaclient/v2/shell.py", line 281, in _boot
image = _find_image(cs, args.image)
File "/usr/lib/python2.7/site-packages/novaclient/v2/shell.py", line 2350, in _find_image
raise exceptions.CommandError(six.text_type(e))
CommandError: Not found (HTTP 404)
ERROR (CommandError): Not found (HTTP 404)

I also found another error further"up" the debug log:

RESP BODY: 404 Not Found

The resource could not be found.

Best Answer

You can delete the current instance and create a new instance with the same ip address. For example, you can use command:

nova boot \
  --flavor <FLAVOR-ID> \
  --image <IMAGE-ID> \
  --nic net-id=<NET-ID>,v4-fixed-ip=<IP-ADDR>,v6-fixed-ip=<IP-ADDR> \
  <NAME>
Related Topic