nova boot block-device-mapping

来源:互联网 发布:淘宝买机票便宜吗 编辑:程序博客网 时间:2024/05/21 17:52

在虚机启动的时候,可以指定挂在一个存储卷,并指定存储卷的挂在点

The following command will boot a new instance and attach a volume at the same time. The volume of ID 13 will be attached as /dev/vdc. It is not a snapshot, does not specify a size, and will not be deleted when the instance is terminated:
$ nova boot --image 4042220e-4f5e-4398-9054-39fbd75a5dd7            --flavor 2 --key-name mykey --block-device-mapping vdc=13:::0 boot-with-vol-test
参数意义如下:
--block-device-mapping <dev-name=mapping> 
The block device mapping format is <dev-name>=<id>:<type>:<size(GB)>:<delete-on-terminate>, where:

其中:
dev-name
A device name where the volume is attached in the system at /dev/dev_name .


id
The ID of the volume to boot from, as shown in the output of nova volume-list.


type
Either snap, which means that the volume was created from a snapshot, or anything other than snap (a blank string is valid). In the example above, the volume was not created from a snapshot, so we leave this field blank in our example below.


size (GB)
The size of the volume in gigabytes. It is safe to leave this blank and have the Compute Service infer the size.


delete-on-terminate
A boolean to indicate whether the volume should be deleted when the instance is terminated. True can be specified as True or 1. False can be specified as False or 0.

0 0
原创粉丝点击