# what is block device mapping in nova?

https://docs.openstack.org/user-guide...

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: https://docs.openstack.org/developer/...

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.

edit retag close merge delete

Sort by » oldest newest most voted

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.

more