[Openstack] Openstack--instance-boot-from-ceph-volume
Karan Singh
ksingh at csc.fi
Thu Dec 5 12:55:23 UTC 2013
Hello Everyone
Thanks for your quick response , i am glad to be a part of such a responsive community
I am using qemu-kvm provided by ceph repository that have RBD support . Using this i am able to create RBD volumes and its working good.
[root at rdo qemu(keystone_admin)]# rbd list ceph-volumes
volume-0e2bfced-be6a-44ec-a3ca-22c771c66cdc
volume-10cc0855-652a-4a9b-baa1-80bc86dc12ac
volume-5e09ce7b-b874-4c24-97ae-341a305841d5
volume-9671edaa-62c8-4f98-a36c-d6e59612141b
volume-a75d435b-ebce-4013-9c68-8df5d2c917e1
volume-dd315dda-b22a-4cf8-8b77-7c2b2f163155
[root at rdo qemu(keystone_admin)]#
I tried below steps needed for booting from volume
http://docs.openstack.org/user-guide/content/boot_from_volume.html
[root at rdo nova(keystone_admin)]# nova image-list
+--------------------------------------+-----------------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+-----------------------------+--------+--------+
| f61edc8d-c9a1-4ff4-b4fc-c8128bd1a10b | Ubuntu 12.04 cloudimg amd64 | ACTIVE | |
| fcc07414-bbb3-4473-a8df-523664c8c9df | ceph-glance-image | ACTIVE | |
| be62a5bf-879f-4d1f-846c-fdef960224ff | precise-cloudimg.raw | ACTIVE | |
| 3c2db0ad-8d1e-400d-ba13-a506448f2a8e | precise-server-cloudimg | ACTIVE | |
+--------------------------------------+-----------------------------+--------+--------+
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]# cinder list
+--------------------------------------+-----------+---------------------------+------+--------------+----------+--------------------------------------+
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+---------------------------+------+--------------+----------+--------------------------------------+
| 0e2bfced-be6a-44ec-a3ca-22c771c66cdc | in-use | nova-vol_1 | 2 | None | false | 9d3c327f-1893-40ff-8a82-16fad9ce6d91 |
| 10cc0855-652a-4a9b-baa1-80bc86dc12ac | available | ceph-vol1 | 5 | ceph-storage | false | |
| 5e09ce7b-b874-4c24-97ae-341a305841d5 | available | precise-cloudimg_vol_boot | 5 | None | true | |
| 9671edaa-62c8-4f98-a36c-d6e59612141b | available | boot_from_volume | 20 | None | false | |
| a75d435b-ebce-4013-9c68-8df5d2c917e1 | available | dashboard-volume | 1 | ceph-storage | false | |
+--------------------------------------+-----------+---------------------------+------+--------------+----------+--------------------------------------+
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]# cinder create --image-id be62a5bf-879f-4d1f-846c-fdef960224ff --display-name new_boot_from_vol 10
+---------------------+--------------------------------------+
| Property | Value |
+---------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| created_at | 2013-12-05T12:34:45.241324 |
| display_description | None |
| display_name | new_boot_from_vol |
| id | dd315dda-b22a-4cf8-8b77-7c2b2f163155 |
| image_id | be62a5bf-879f-4d1f-846c-fdef960224ff |
| metadata | {} |
| size | 10 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| volume_type | None |
+---------------------+--------------------------------------+
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]# cinder list
+--------------------------------------+-----------+---------------------------+------+--------------+----------+--------------------------------------+
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+---------------------------+------+--------------+----------+--------------------------------------+
| 0e2bfced-be6a-44ec-a3ca-22c771c66cdc | in-use | nova-vol_1 | 2 | None | false | 9d3c327f-1893-40ff-8a82-16fad9ce6d91 |
| 10cc0855-652a-4a9b-baa1-80bc86dc12ac | available | ceph-vol1 | 5 | ceph-storage | false | |
| 5e09ce7b-b874-4c24-97ae-341a305841d5 | available | precise-cloudimg_vol_boot | 5 | None | true | |
| 9671edaa-62c8-4f98-a36c-d6e59612141b | available | boot_from_volume | 20 | None | false | |
| a75d435b-ebce-4013-9c68-8df5d2c917e1 | available | dashboard-volume | 1 | ceph-storage | false | |
| dd315dda-b22a-4cf8-8b77-7c2b2f163155 | available | new_boot_from_vol | 10 | None | true | |
+--------------------------------------+-----------+---------------------------+------+--------------+----------+--------------------------------------+
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]# nova boot --flavor 2 --image be62a5bf-879f-4d1f-846c-fdef960224ff --block_device_mapping vda=dd315dda-b22a-4cf8-8b77-7c2b2f163155:::0 --security_groups=default --nic net-id=4fe5909e-02db-4517-89f2-1278248fa26c myInstanceFromVolume
+--------------------------------------+----------------------------------------------------+
| Property | Value |
+--------------------------------------+----------------------------------------------------+
| OS-EXT-STS:task_state | scheduling |
| image | precise-cloudimg.raw |
| OS-EXT-STS:vm_state | building |
| OS-EXT-SRV-ATTR:instance_name | instance-0000001d |
| OS-SRV-USG:launched_at | None |
| flavor | m1.small |
| id | f324e9b8-ec3a-4174-8b97-bf78dba62932 |
| security_groups | [{u'name': u'default'}] |
| user_id | 99f8019ba2694d78a680a5de46aa1afd |
| OS-DCF:diskConfig | MANUAL |
| accessIPv4 | |
| accessIPv6 | |
| progress | 0 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-AZ:availability_zone | nova |
| config_drive | |
| status | BUILD |
| updated | 2013-12-05T12:42:22Z |
| hostId | |
| OS-EXT-SRV-ATTR:host | None |
| OS-SRV-USG:terminated_at | None |
| key_name | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| name | myInstanceFromVolume |
| adminPass | eish5pu56CiE |
| tenant_id | 0dafe42cfde242ddbb67b681f59bdb00 |
| created | 2013-12-05T12:42:21Z |
| os-extended-volumes:volumes_attached | [{u'id': u'dd315dda-b22a-4cf8-8b77-7c2b2f163155'}] |
| metadata | {} |
+--------------------------------------+----------------------------------------------------+
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]#
[root at rdo nova(keystone_admin)]# nova list
+--------------------------------------+----------------------+---------+------------+-------------+---------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+----------------------+---------+------------+-------------+---------------------+
| 0043a8be-60d1-43ed-ba43-1ccd0bba7559 | instance2 | SHUTOFF | None | Shutdown | public=172.24.4.228 |
| f324e9b8-ec3a-4174-8b97-bf78dba62932 | myInstanceFromVolume | ERROR | None | NOSTATE | private=10.0.0.3 |
| 9d3c327f-1893-40ff-8a82-16fad9ce6d91 | small-ubuntu | ACTIVE | None | Running | public=172.24.4.230 |
+--------------------------------------+----------------------+---------+------------+-------------+---------------------+
[root at rdo nova(keystone_admin)]#
=====================================
Logs from /var/log/libvirt/qemu ::
=====================================
qemu-kvm: -drive file=rbd:ceph-volumes/volume-dd315dda-b22a-4cf8-8b77-7c2b2f163155:id=volumes:key=AQC804xS8HzFJxAAD/zzQ8LMzq9wDLq/5a472g==:auth_supported=cephx\;none:mon_host=192.168.1.31\:6789\;192.168.1.33\:6789\;192.168.1.38\:6789,if=none,id=drive-virtio-disk0,format=raw,serial=dd315dda-b22a-4cf8-8b77-7c2b2f163155,cache=none: could not open disk image rbd:ceph-volumes/volume-dd315dda-b22a-4cf8-8b77-7c2b2f163155:id=volumes:key=AQC804xS8HzFJxAAD/zzQ8LMzq9wDLq/5a472g==:auth_supported=cephx\;none:mon_host=192.168.1.31\:6789\;192.168.1.33\:6789\;192.168.1.38\:6789: No such file or directory
2013-12-05 12:42:29.544+0000: shutting down
Any idea why its throwing this error.
Many Thanks
Karan Singh
----- Original Message -----
From: "Darren Birkett" <darren.birkett at gmail.com>
To: "Karan Singh" <ksingh at csc.fi>
Sent: Thursday, 5 December, 2013 2:37:27 PM
Subject: Re: [Openstack] Openstack--instance-boot-from-ceph-volume
Hi Karan,
On 5 December 2013 12:24, Karan Singh < ksingh at csc.fi > wrote:
Hello Stackers
Wondering if someone got Openstack Instance booted from ceph volume successfully , can help me to do it.
As of now , i have running ceph cluster which is integrated with Openstack ciner and glance , i can create volumes and put images from OS to ceph , this is working good.
My next target is to boot instance from volume. Can you share steps or instructions how you get it done. It would be great if you can help me setting this up.
Thanks a ton in advance
My setup --> ceph Dumpling , OS havana , Centos 6.5
If you're using Centos, you'll need a qemu-kvm that is built with rbd support. You can grab this src rpm for qemu-kvm-rhev from Redhat and build it yourself:
http://ftp.redhat.com/redhat/linux/enterprise/6Server/en/RHEV/SRPMS/qemu-kvm-rhev-0.12.1.2-2.415.el6.src.rpm
Using:
rpmbuild -ba --with rhev_features --without guest_agent qemu-kvm.spec
Then install the qemu-kvm-rhev and qemu-kvm-img that it builds - they will obsolete the qemu-kvm and qemu-img that come as part of the base CentOS.
Then it's just a matter of creating your cinder volume from an image in glance (you need to use a raw image in glance):
[root at cent-comp1 ~]# glance image-list
+--------------------------------------+--------------+-------------+------------------+----------+--------+
| ID | Name | Disk Format | Container Format | Size | Status |
+--------------------------------------+--------------+-------------+------------------+----------+--------+
| eada58eb-14ac-4a36-940f-794e9c3ef633 | cirros-image | qcow2 | bare | 13147648 | active |
| 1c31a2ca-7f50-44d7-84d5-a16fbbafbfa7 | cirros-raw | raw | bare | 41126400 | active |
+--------------------------------------+--------------+-------------+------------------+----------+--------+
[root at cent-comp1 ~]# cinder create --image-id 1c31a2ca-7f50-44d7-84d5-a16fbbafbfa7 --display-name my-bootable-volume 5
+---------------------+--------------------------------------+
| Property | Value |
+---------------------+--------------------------------------+
| attachments | [] |
| availability_zone | nova |
| bootable | false |
| created_at | 2013-12-05T12:36:19.502399 |
| display_description | None |
| display_name | my-bootable-volume |
| id | 3d0199e0-4762-4e71-8eea-216b69c6e36c |
| image_id | 1c31a2ca-7f50-44d7-84d5-a16fbbafbfa7 |
| metadata | {} |
| size | 5 |
| snapshot_id | None |
| source_volid | None |
| status | creating |
| volume_type | None |
+---------------------+--------------------------------------+
[root at cent-comp1 ~]# nova boot --boot-volume 3d0199e0-4762-4e71-8eea-216b69c6e36c --flavor 1 myserver
+--------------------------------------+----------------------------------------------------+
| Property | Value |
+--------------------------------------+----------------------------------------------------+
| OS-EXT-STS:task_state | scheduling |
| image | Attempt to boot from volume - no image supplied |
| OS-EXT-STS:vm_state | building |
| OS-EXT-SRV-ATTR:instance_name | instance-00000017 |
| OS-SRV-USG:launched_at | None |
| flavor | m1.tiny |
| id | 7b28b8b7-75d0-4d57-8313-a4c78c021e54 |
| security_groups | [{u'name': u'default'}] |
| user_id | 772c04a676dc40288d8e77aece774103 |
| OS-DCF:diskConfig | MANUAL |
| accessIPv4 | |
| accessIPv6 | |
| progress | 0 |
| OS-EXT-STS:power_state | 0 |
| OS-EXT-AZ:availability_zone | nova |
| config_drive | |
| status | BUILD |
| updated | 2013-12-05T12:36:49Z |
| hostId | |
| OS-EXT-SRV-ATTR:host | None |
| OS-SRV-USG:terminated_at | None |
| key_name | None |
| OS-EXT-SRV-ATTR:hypervisor_hostname | None |
| name | myserver |
| adminPass | QCZAS6cPNGkP |
| tenant_id | f1b863076b36422091d13d85bb127c4d |
| created | 2013-12-05T12:36:49Z |
| os-extended-volumes:volumes_attached | [{u'id': u'3d0199e0-4762-4e71-8eea-216b69c6e36c'}] |
| metadata | {} |
+--------------------------------------+----------------------------------------------------+
Thanks
Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20131205/dd78b6c3/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: undefined
Type: image/gif
Size: 323 bytes
Desc: not available
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20131205/dd78b6c3/attachment.gif>
More information about the Openstack
mailing list