Ask Your Question
0

Ephemeral/Persistent disks

asked 2013-02-06 09:06:24 -0500

khedhermail gravatar image

Hi, Actually I am running OpenStack Folsom release and I was wondering about the point that OpenStack handle the disks. When we ask Nova to boot a VM, nova-compute will connect to Glance and "GET" the image file from Glance and save it on the its local filesystem. So by default the disk of an instance is basically stored on the local filesystem of the server where the instance is running that is the 'ephemeral' disk. In oppoiste of persistent disks, the ephemeral disks will be discarded if the VM is shut down and on failures.

Is that possible to make nova boot the primary disk 'ephemeral' as persistent from a volume instead in the local machine runing the hypervisor ?

edit retag flag offensive close merge delete

10 answers

Sort by ยป oldest newest most voted
0

answered 2013-02-08 12:18:43 -0500

johngarbutt gravatar image

Can you get hold of the nova-compute logs? That should give us more help about what is going wrong.

edit flag offensive delete link more
0

answered 2013-02-11 08:13:02 -0500

khedhermail gravatar image

Thanks for your response. It helps by mentionning vda as you said before but still wondering about the 'vda' as a first disk for example will be created once the command launched ? and what is the differene between this way and using a cindervol2 as created above ?

edit flag offensive delete link more
0

answered 2013-02-14 13:41:54 -0500

khedhermail gravatar image

Thanks John Garbutt, that solved my question.

edit flag offensive delete link more
0

answered 2013-02-08 16:07:20 -0500

khedhermail gravatar image

I did not see how libvirt should recognise 'volcinder2' as a device. is that /dev/vda naming imporant for that ?

edit flag offensive delete link more
0

answered 2013-02-06 18:12:57 -0500

johngarbutt gravatar image

Basically a persistent disk == a volume

I think you are looking for the "boot from volume" feature: http://docs.openstack.org/trunk/openstack-compute/admin/content/boot-from-volume.html (http://docs.openstack.org/trunk/opens...)

With newer versions, Cinder drivers you can create the volume from a Glance image.

An example is in DevStack: https://github.com/openstack-dev/devstack/blob/master/exercises/boot_from_volume.sh (https://github.com/openstack-dev/devs...)

It is a bit more manual to create a good volume in Folsom, see this: https://github.com/openstack-dev/devstack/blob/stable/folsom/exercises/boot_from_volume.sh (https://github.com/openstack-dev/devs...)

edit flag offensive delete link more
0

answered 2013-02-07 17:40:58 -0500

khedhermail gravatar image

Thanks for the response, In fact I used cinder as volume backend and followed the example above. Once created a vm, it shows an error status without mentioning any reason in log files nova or cinder log files. I was checking /var/lib/nova/instances to check the instance created but no new instance000000x was created in the folder. I checked also nova show vm and as OS-EXT-SRV-ATTR:instance_name was instance-0000000a. that means as far as I understand that the ephemeral disk is created [folder disk] in cinder-volumes level. Could the be reason of the error ?

edit flag offensive delete link more
0

answered 2013-02-08 11:39:47 -0500

khedhermail gravatar image

The instance created booted from that volume shows ERROR status in nova list instances. However I can ping it. No errors shown actually. try to figure out how it was done I could see in the /var/lib/nova/instances/instance000000x/libvirt.xml the creation of two types of disk [file and block types] <disk type="file" device="disk"> <driver name="qemu" type="qcow2" cache="none"/> <source file="/var/lib/nova/instances/instance-00000011/disk"/> <target bus="virtio" dev="vda"/> </disk> <disk type="block" device="disk"> <driver name="qemu" type="raw" cache="none"/> <source dev="/dev/disk/by-path/ip-172.16.0.3:3260-iscsi-iqn.2010-10.org.openstack:volume-19fd60dc-0b6e-4b11-8fc0-5cd32e45dacd-lun-1"/> <target bus="virtio" dev="volcinder2"/> </disk>

Is still something missing ?

edit flag offensive delete link more
0

answered 2013-02-08 14:06:47 -0500

khedhermail gravatar image

tail -n150 /var/log/nova/nova-compute.log | grep error:

TRACE nova.compute.manager [instance: 618c913c-f47d-4449-95cb-2501fdf72bcd] libvirtError: internal error Invalid harddisk device name: volcinder2 TRACE nova.openstack.common.rpc.amqp self._set_instance_error_state(context, instance['uuid']) TRACE nova.openstack.common.rpc.amqp libvirtError: internal error Invalid harddisk device name: volcinder2

it seems that the cinder volume not recognized by nova. It s already configured in cinder.conf file. To create that volume group I proceeded as follows:

dd if=/dev/zero of=volcinder2 bs=1 count=0 seek=6G losetup /dev/loop3 volcinder2 fdisk /dev/loop3

Then we could see i cinder list the new volume group created and available.

Just after executing nova boot as follows: nova boot --flavor 1 --image Test --key_name mykey --block-device-mapping volcinder2=19fd60dc-0b6e-4b11-8fc0-5cd32e45dacd:::0 ServerFromBoot

show building --> Error status.

???

n p 1 ENTER ENTER t 8e w

pvcreate /dev/loop3 vgcreate volcinder2 /dev/loop3

edit flag offensive delete link more
0

answered 2013-02-08 15:54:25 -0500

johngarbutt gravatar image

Hmm, that certainly could be a better error message.

The bit you have as "volcinder2" is meant to be a device, like "/dev/vda" (can't remember what the correct letters for "vd" are in your case.

Give that a whirl and see if it helps. You need something that libvirt (in your case) recognises as a device name.

I hope that helps get you a bit further.

edit flag offensive delete link more
0

answered 2013-02-08 16:26:27 -0500

johngarbutt gravatar image

Take a look at how the exercise script works: https://github.com/openstack-dev/devstack/blob/stable/folsom/exercises/boot_from_volume.sh#L204 (https://github.com/openstack-dev/devs...)

What you want is: nova boot --flavor 1 --image Test --key_name mykey --block-device-mapping vda=19fd60dc-0b6e-4b11-8fc0-5cd32e45dacd:::0 ServerFromBoot

The "vda" means first disk, where "vdb" would mean second disk, in the usual unixy way.

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

Stats

Asked: 2013-02-06 09:06:24 -0500

Seen: 810 times

Last updated: Feb 14 '13