[Openstack] Copy glance image to cinder bootable volumes - "copy_image_to_volume"

Martinx - ジェームズ thiagocmartinsc at gmail.com
Wed Jan 30 19:14:48 UTC 2013


BTW!

On the step 2, if you install a "Ubuntu Minimal Virtual Machine", select
"Guided LVM Partitioning". This way, when you make a 5~10~50G boot-volume,
you'll be able to easily grow your Ubuntu file systems (from 2.5G inicial)
using its internal LVM (try parted instead of fdisk/cfdisk!)... You'll see
extra HD space to make more primary/extended/GPT partitions...

Cheers!
Thiago

On 30 January 2013 16:47, Martinx - ジェームズ <thiagocmartinsc at gmail.com> wrote:

> What I just did to successfully "boot from a volume":
>
> 1- Create a KVM Virtual Machine on top of a LVM Logical Volume of 2.5G as
> its HD (disk type block - /dev/volgrp0/vmname-disk0);
>
> 2- Install your favorite OS;
>
> 3- shutdown it;
>
> 4- make a image of it: dd if=/dev/volgrp0/vmname-disk0
> of=myfavorite-os.img;
>
> 5- copy it to your Cinder server: scp myfavorite-os.img to the server
> where your "cinder-volumes LVM VG" resides;
>
> 6- make a volume of ~5G via Openstack Dashboard or CLI;
>
> 7- find your "cloud cinder volume" on the Cinder server: lvdisplay
>
> 8- import your 2.5G image (myfavorite-os.img) into your Cinder volume: dd
> if=/path/of/myfavorite-os.img
> of=/dev/cinder-volumes/volume-a2fb85b1-512e-402b-9aaf-6ce1914295a4;
>
> 9- start a instance using any image as source (cirros) and choose to boot
> from this volume (a2fb85b1-512e-402b-9aaf-6ce1914295a4). The image source
> (cirros) will be ignored, I think...
>
> That's it!
>
> NOTE: If you can run a KVM VM on the same server of your Cinder, you can
> shrink part of this procedure, by doing it more directly: "dd
> if=/dev/volgrp0/vmname-disk0
> of=/dev/cinder-volumes/volume-a2fb85b1-512e-402b-9aaf-6ce1914295a4" on step
> 4 (your cinder volume must be ready on that point).
>
> I prefer to make specific flavors to use with my "boot-from-volume"
> Instances.
>
> Best!
> Thiago
>
>
> On 30 January 2013 13:06, Avishay Traeger <AVISHAY at il.ibm.com> wrote:
>
>> Lei Zhang <zhang.lei.fly at gmail.com> wrote on 01/30/2013 04:39:22 PM:
>> > I also have a question. What's the requirement for the image? I
>> > found nothing int the doc.
>>
>> Hi,
>> The requirements that I can think of off the top of my head are:
>> 1. The image should be bootable
>> 2. The image is converted to raw before being written to the volume, so it
>> should be a format the 'qemu-img' understands (raw, qcow2, vmdk, vdi)
>> 3. There must be sufficient space to write the raw version of the image
>>
>> Thanks,
>> Avishay
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~openstack
>> Post to     : openstack at lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~openstack
>> More help   : https://help.launchpad.net/ListHelp
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20130130/c47a512d/attachment.html>


More information about the Openstack mailing list