Rescue an instance
In case of a system or access failure, it is possible to rescue an instance. Due to limitations of OpenStack, the Rescue Instance
feature is only available on instances that do not have an volume attached. Nevertheless we present an option for instances that have their root disk as volume.
If you don’t know if the instance’s root disk is a volume or not, then read the I want to know if the instance disk is a persistent volume
topic on the Storage page.
Rescue an instance without a volume (ephemeral disk)
-
On the VMCloud portal, select the
Rescue Instance
option on the desired instance. This will create a temporary instance with the original disk mounted as secondary. -
The instance will go to the
Rescue
status and when theTask
property goes fromRescuing
toNone
, the instance is ready for login via SSH. Depending on the selected image, the login user may vary from the original. Check the Images page to confirm the login user for the temporary instance. Also, a SSH warning may appear due to the fact that the fingerprint has changed for the same IP address, since it is a new instance. Fix this with the indicatedssh-keygen
command, this will be done again after the instance is rescued. -
After logging into the instance, check if the original disk is detected, typically as
vdb
:debian@baba:~$ sudo su root@baba:/home/debian# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda 254:0 0 1.7G 0 disk └─vda1 254:1 0 1.7G 0 part / vdb 254:16 0 10G 0 disk ├─vdb1 254:17 0 10G 0 part └─vdb15 254:31 0 8M 0 part
-
Mount the original disk and then perform the needed changes:
root@baba:~# mkdir /mnt/disk root@baba:~# mount /dev/vdb1 /mnt/disk/ root@baba:~# ls /mnt/disk/ bin boot dev etc home init initrd.img lib lib64 linuxrc lost+found media mnt old-root opt proc root run sbin sys tmp usr var vmlinuz
-
After all the necessary changes are done, unmount the original disk and exit:
root@baba:~# umount /mnt/disk root@baba:~# exit
-
Finally, on the VMCloud portal, select the
Unrescue Instance
option, theStatus
property will go toActive
and the original disk will be launched. After a few seconds, the original instance will be available and hopefully fixed.
Rescue an instance with a volume (persistent disk)
NOTE: As these instructions are an alternative to the Rescue Instance
feature for instances with volumes, please read very carefully and proceed with caution. This procedure involves changing Instance, Volume and Network settings.
- Go to the instance’s page on VMCloud, then go to the
Interfaces
tab and click on the name of the interface. Then copy all the information on theOverview
tab to a text editor, so that we will have all the instance’s network information saved, such as IP addresses, MAC address and so on.
Name
None
ID
0dc93acf-cxx3-4aa0-a2a5-1daxxxxxx
Network Name
n-xxxx
Network ID
xxxx432-8xx02-46xx0-864e-9bbxxxxx5
Project ID
xxx542084xxxxxxxxxxxxxxxxxxxx
MAC Address
fa:16:3e:xx:xx:xx
Status
Active
Admin State
UP
Port Security Enabled
True
DNS Name
vbn
DNS Assignment
(...)
- Additionally on the instance’s page, note the volume ID on the
Volumes Attached
section, as this volume will be used again later on, and also other relevant information, such as flavor, security groups, etc.
Volumes Attached
Attached To
4a7xxxxb66-e0b3-4x44-b429-396xxxx2c on /dev/vda
-
If you do not know if the instance was created with the
Delete Volume on Instance Delete
option, then read theI don't know if I created the instance volume with the Delete Volume on Instance Delete option
topic on the Storage page. This is essential, as we do not want to delete the original volume. Otherwise, if you know the option was not set, then just delete the original instance. -
After the original instance is deleted, go to the
Volumes -> Volumes
page to confirm that the volume previously attached to the original instance becomes available. -
Create a new instance. The specifications of this instance are not relevant, as this instance is temporary. Check the Images page to confirm the login user for the temporary instance.
-
Select the
Attach Volume
option on the new instance, select the volume with the ID that was indicated in the original instance’s page and click onAttach Volume
. -
Log into the new instance via SSH and check if the original disk is detected, typically as
vdb
:debian@baba:~$ sudo su root@baba:/home/debian# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT vda 254:0 0 1.7G 0 disk └─vda1 254:1 0 1.7G 0 part / vdb 254:16 0 10G 0 disk ├─vdb1 254:17 0 10G 0 part └─vdb15 254:31 0 8M 0 part
-
Mount the original disk:
root@baba:~# mkdir /mnt/disk root@baba:~# mount /dev/vdb1 /mnt/disk/ root@baba:~# ls /mnt/disk/ bin boot dev etc home init initrd.img lib lib64 linuxrc lost+found media mnt old-root opt proc root run sbin sys tmp usr var vmlinuz
-
Now perform the necessary changes and fixes on the disk.
-
After all the necessary changes are done, unmount the original disk and exit:
root@baba:/mnt/disk# cd root@baba:~# umount /mnt/disk root@baba:~# exit
-
Delete the temporary instance and go to the
Volumes -> Volumes
page to confirm that the original volume becomes available. -
Go to the
Networks -> Network
page, click on the project network (n-[project name]
), select thePorts
tab and click onCreate Port
. Insert the following information and click onCreate
:Name
: Does not matter, as long it is something identifiable, instance name for example.Enable Admin State
: Checked/Yes/TrueDevice ID
: Leave blankDevice Owner
: Leave blankSpecify IP address or subnet
:FIXED IP ADDRESS
Fixed IP Address
: The IP address, in IPv4 form, indicated on the original instance’s network information. Format:xxx.xxx.xxx.xxx
MAC Address
: The MAC address indicated on the original instance’s network information. Format:xx:xx:xx:xx:xx:xx
Port Security
: Checked/Yes/TrueVNIC Type
:NORMAL
-
Go to the
Instances
page and launch an instance with the following specifications:Details
tab:Name
: Same name as the original instance
Source
tab:Select Boot Source
:Volume
- On the
Available
section, click on the upwards arrow of the volume with the original ID asName
. It should go to theAllocated
section.
Flavor
tab:- Select the flavor of the original instance
Networks
tab:- On the
Allocated
section, click on the downwards arrow of the project network. It should go to theAvailable
section. TheAllocated
section should be empty.
- On the
Network Ports
tab:- On the
Available
section, click on the upwards arrow of the created port. It should go to theAllocated
section.
- On the
- On the remaining tabs, if the original instance had additional configurations, such as security groups, then add them.
-
A new instance will be created and will be ready for login. IT should be the same as the original with the additional fixes and changes. When logging in with the original user, a SSH warning may appear due to the fact that the fingerprint has changed for the same IP address, since it is a new instance. Fix this with the
ssh-keygen
command indicated in the warning.