Ask Your Question

what is block device mapping in nova?

asked 2017-05-05 02:07:03 -0500

zero gravatar image

I have read the doc about boot a openstack nova instance in this link

There is a command saying: Create volume from image and boot instance, the command is like below.

openstack server create --flavor FLAVOR --block-device \ source=SOURCE,id=ID,dest=DEST,size=SIZE,shutdown=PRESERVE,bootindex=INDEX \ NAME

I do not quite understand what the parameters source=SOURCE and dest=DEST mean? does it mean source=image and dest=volume?

the source, in fact, can be many types (volume, snapshot, image, and blank) the dest can be volume and local.

I refer to this doc:

It says: Combination of the source and dest parameters would define what kind of block device the entry is referring to.

these combination, does it mean to copy the boot information from source to destination volume and attach the volume to the instance, then boot up the instance with the volume? volume -> volume, snapshot -> volume, image -> volume

does this mean just boot a instance from image and attache the destination volume? blank -> volume

I do not understand what the local means ? the host machine or guest local file? image -> local, blank -> local

I refer to this doc. it says : Block device mapping is a way to organize and keep data about all of the block devices an instance has.

but when the nova instance boot up, it only have one block device, or multiple block devices?

I am so confused about the block device mapping and the combination among source and destination.

Anyone can help please, thanks in advance.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-05-05 03:39:11 -0500

Be aware that block device mapping is not only used to boot an instance, but generally to attach storage to an instance. You can attach storage at boot time or later using the openstack server add command.

"the source, in fact, can be many types (volume, snapshot, image, and blank) the dest can be volume and local" That's the answer to the first question. Not all combinations make sense or are supported.

Local means ephemeral storage. Very often, an instance has source=image and dest=local. This combination can be achieved without the --block-device option; just use the --image option. Recent versions of the dashboard have a default of source=image, dest=volume.

Source=blank and dest=local creates a blank ephemeral disk. You need to specify the size. Source=blank and dest=volume (not sure if it works) implies that a volume is created from scratch, then attached to the instance. Obviously, you can't boot from such a block device.

Source=volume and dest=volume attaches an existing volume to the instance.

You can use the --image option and one or more --block-device options to connect two or more disks to the instance right at boot time. The first disk is the boot and root disk, the other disks might be blank volumes or pre-existing volumes.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2017-05-05 02:07:03 -0500

Seen: 2,184 times

Last updated: May 05 '17