ContainX / openstack4j

A Fluent OpenStack SDK / Client Library for Java
http://openstack4j.com
Other
290 stars 367 forks source link

How can I create Instance with two or three volumes attached on boot? #1036

Open fenggeyeyin opened 7 years ago

fenggeyeyin commented 7 years ago

In offical docs i know i can boot instance with one volume like this : _BlockDeviceMappingBuilder blockDeviceMappingBuilder = Builders.blockDeviceMapping() .uuid(volumeId) .deviceName("/dev/vda") .bootIndex(0);

ServerCreate sc = Builders.server().name("Server").blockDevice(blockDeviceMappingBuilder.build()); Server server = os.compute().servers().boot(sc);_

But for some reason , i must boot with 2 volumes , one of them is used as data disk. So how can i create instance with multi volumes as BlockDeviceMapping ??

auhlig commented 7 years ago

Hi @fenggeyeyin, Is this supported by Openstack itself? If so, could you provide a link to the corresponding documentation?

reda-jaifar commented 7 years ago

Hi, This is possible with the usage of block device mapping, for further details here is the documentation: https://docs.openstack.org/nova/latest/block_device_mapping.html