VM created with option "Create New Volume" and additional Volume attached

It is a common problem with using additional volumes if we have created a new instance with a real volume before. After performing a particular operation, our virtual machine is unable to boot.

This article splits up in two sections: reproduction of the issue and workaround for CREODIAS users.

 


Reproduction:

1. Create a virtual machine with a new real root disk.

 

2. Click on the name of your instance.

 

3. Verify the type of the disk. It has been set up as vda. (Within a virtual machine it is visible as sda)

 

4. Create additional volume and attach it to the Instance. It has been set up as sda. (Within a virtual machine it is visible as sdb)

 

5. If you choose one of those options: [...]

  • Shelve Instance

  • Soft Reboot Instance

  • Hard Reboot Instance

Your instance will become unavailable to boot:

Why did it happen? The additional volume (which does not contain any OS) has been chosen as a sda device during booting this time.

 


Solution:

To overcome this issue, you have to create a virtual machine with real root disk using Openstack CLI.

1. Source your RC file and use this command to create a bootable volume:

User@CREODIAS:~$ openstack volume create --image image_id --size 5 name_of_the_volume

 

2. As you may see, you have created a bootable volume with Image Ubuntu 18.04.

 

3. Now you can create a virtual machine:

User@CREODIAS:~$ openstack server create --volume volume_id --flavor flavor_name --key-name key_name --security-group security_group_id --network network_id name_of_the_virtual_machine

 

4. The instance has been deployed. Go to Instance details.

Attached volume has a proper sda prefix.