It can happen that an OpenStack instance is no longer accessible via the console or other methods, for example, if you have lost the root password. In such a case, using a rescue image is necessary. With this, you can boot your instance and reset the root password or secure data.
In this tutorial, we'll show you how to use a rescue image on an OpenStack instance. Note: This requires using the OpenStack Command Line toolkit.
Step 1
To use a rescue image, you need the ID of the respective instance. The command below gives you an overview of your instances, including their names and IDs:
openstack server list
Note the ID of the instance you want to boot using a rescue image.
Step 2
First, shut down the instance with the following command. Replace <InstanceID> with the ID noted in step 1.
openstack server stop <InstanceID>
Then, restart the instance with the rescue image.
nova rescue <InstanceID> --image a275f44c-69bd-4c9b-9096-db681f7f68e4
You will now see a password for the root user. You need this for SSH connections; via the console in Horizon, you are automatically logged in as the root user.
+-----------+--------------+ | Property | Value | +-----------+--------------+ | adminPass | ZwfmR8N7nQbU | +-----------+--------------+
Note: You might also receive a deprecated warning, but you can ignore it. When we eventually upgrade the underlying platform to a version where this procedure has been adjusted, we will update this article accordingly.
Now, when you check your server, you'll see that the vm_state is set to 'rescued':
openstack server show 3614d853-0991-4a40-ba2f-9bcee920151b | grep vm_state
Step 3
There are now two ways to connect to your instance:
- Using the console in the Horizon web interface. This option has two advantages:
- You are automatically logged in as the root user.
- When starting the rescue image, you will see a number of boot options. It takes a while for the first one to be automatically selected. Via the console, you can directly choose an option and get started with the rescue image more quickly.
- Using SSH: For this, you use the root user and the IP address of your instance, for example:
ssh root@123.123.123.123
As mentioned earlier, the rescue image is a useful tool for resetting the administrator (Windows) or root (Linux) password. For this, you can use the following guides: