Community

Connecting host with new volume from image to boot from

Hi,

If I create a volume with the following commands, the volume is created and attached, but the virtual machine can not boot. Furthermore most of the named options like '--bus VIRTIO' are not recognized.

$ profitbricks volume create --datacenterid 701424d7-d978-468b-8065-24ea01be22ee --imageid 5f81ebe4-3805-11e5-895c-52540066fee9 --name BootVolume2 --size 10 --bus VIRTIO --bootVolume --licencetype LINUX --cpuHotPlug --cpuHotUnplug --ramHotPlug --ramHotUnplug --nicHotPlug --nicHotUnplug --discVirtioHotPlug --discVirtioHotUnplug --discScsiHotPlug --discScsiHotUnplug

$ profitbricks server create --datacenterid 701424d7-d978-468b-8065-24ea01be22ee --cores 1 --name "DemoServer" --ram 1024

$ profitbricks volume attach --datacenterid 701424d7-d978-468b-8065-24ea01be22ee --serverid c849b218-5576-4572-9f73-c25f8ec96ff6 -i ebf1b635-e3b7-4608-9d1c-18c1bf7499f2

When I start the server then the console shows that it can not boot due to the fact that it can not find a boot device.

Can somebody describe commands, which create a VM with an image and all options shown above to make the VM booting and being reachable?

Thanks in advance

Georg

 
  • **bold**
  • _italics_
  • `code`
  • ```code block```
  • # Heading 1
  • ## Heading 2
  • > Quote
 

After attaching a volume to your server you have to set it as a boot device on the server.

$ profitbricks server update --bootVolume ebf1b635-e3b7-4608-9d1c-18c1bf7499f2

Alternatively you can add a bootVolume as a server creation parameter:

$ profitbricks server create --datacenterid 701424d7-d978-468b-8065-24ea01be22ee --cores 1 --name "DemoServer" --ram 1024 --bootVolume ebf1b635-e3b7-4608-9d1c-18c1bf7499f2

Hi botchniaqe

does not work. The volume created is not bootable because it seems not to be created by using the image. Here there is a similar question: https://devops.profitbricks.com/community/provide-volume-with-an-image/

I tried with the following script:

#/bin/bash!

Distribution=CentOS-7
Place=lasdev
Country=us
VDCname=LearnAPI2
VDCdescription="CLI Demo Data Center"

Source=$(profitbricks image list | grep $Distribution | grep $Place | grep -E -o '^[a-z0-9\-]{36}\>')

VDC=$(profitbricks datacenter create --name "$VDCname" --description "$VDCdescription" --location "$Country/$Place" | grep -E -o '\<[a-z0-9\-]{36}\>')

Volume=$(profitbricks volume create --datacenterid $VDC --size 10 --licencetype LINUX --name "DemoSrvr1Boot" --imageid $Source | grep -E -o '\<[a-z0-9\-]{36}\>')
sleep 600

Server=$(profitbricks server create --datacenterid $VDC  --cores 1 --name "DemoServer1" --ram 1024  | grep -E -o '\<[a-z0-9\-]{36}\>')
sleep 300

profitbricks volume attach --datacenterid $VDC   --serverid $Server    -i $Volume
sleep 300
profitbricks volume update --bootVolume --id $Volume --datacenterid $VDC

Lan=$(profitbricks lan create --datacenterid $VDC --public --name "external")
Lan=$(echo $Lan | cut -d  " " -f9)
profitbricks nic create --datacenterid $VDC --serverid $Server --lan $Lan --public --dhcp

profitbricks server start --datacenterid $VDC --id $Server

I have provided a fix for cli (hopefully changes will be deployed soon). Now that syntax should work:

create volume:

#Note that licenceType will be inherited from image, so not needed as a parameter
profitbricks volume create --datacenterid $VDC --size 10 --name "DemoSrvr1Boot" --imageid $Source

update server:

profitbricks server update --datacenterid $VDC --bootVolume $Volume --id $Server

alternatively you can specify boot volume at creation time

profitbricks server create --datacenterid $VDC --bootVolume $Volume --cores 1 --name "DemoServer1" --ram 1024

One of the comments on this question references Place=lasdev which is no longer valid. It should be changed to las in order to use the us\las location.