Hi Jay,<br><br>Thanks for your reply, it helped me get started.<br><br>I have been going through the code and some of the sparse docs that are available.<br><br>This is the code file <a href="https://github.com/openstack/nova/blob/master/nova/virt/libvirt/utils.py">https://github.com/openstack/nova/blob/master/nova/virt/libvirt/utils.py</a><br>
<br>However I am facing a new issue and require some help. I wanted to modify how openstack handles the cow layer as such and also the qcow2 format.<br>It turns out that openstack issues the external command "qemu-img".<br>
<br>First of all, is qemu-img internal to openstack ( I mean code for how qemu-img is implemented is in openstack or in qemu )<br>It is in openstack, where is the code located.<br><br>If it is outside openstack, does that mean i have to change the code in qemu and then link those binaries with openstack.<br>
<br>Any help would be appreciated.<br><br>Thanks,<br>Gaurab<br><br><br><br><div class="gmail_quote">On Sun, Jul 29, 2012 at 6:35 AM, Jay Pipes <span dir="ltr"><<a href="mailto:jaypipes@gmail.com" target="_blank">jaypipes@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 07/28/2012 11:10 AM, Gaurab Basu wrote:<br>
> Another thing I would like to know is whether it uses snapshot mechanism<br>
> over time.<br>
<br>
</div>What is "it" you are referring to above? Are you asking whether Nova<br>
automatically takes snapshots of images over time? If so, no, it does<br>
not. If a user requests a snapshot of a launched instance, then Nova<br>
will issue snapshot commands -- in the case of the libvirt driver, these<br>
commands would be qemu-img snapshot -c <SNAPSHOT_NAME> <IMAGE_PATH>.<br>
<div class="im"><br>
> I mean how does the copy on write functionality works. Does it keep the<br>
> diff snapshots over time ( or something else ).<br>
<br>
</div>Not sure here whether you are asking how QEMU's copy on write operations<br>
work or whether Nova keeps the base images separate from any VM images.<br>
If you are asking about the latter, the answer is that Nova will create<br>
the virtual machine images by creating a COW image based on the base<br>
image it pulls from Glance -- after making a resized copy of the base<br>
image if it needs to do so to meet the needs of the requested image size<br>
of the VM.<br>
<br>
Snapshots that are taken of virtual machine images on a host are stored<br>
by Nova in Glance.<br>
<div class="im"><br>
> And does the diff work at the level of file or block level?<br>
<br>
</div>AFAIK, CoW and snapshot actions with QEMU are block-level.<br>
<div class="im"><br>
> What is the format that the image is converted to after it is fetched<br>
> from glance.<br>
<br>
</div>There may be no conversion needed at all... it depends on what the<br>
format of the original base image that was stored in Glance. Conversion<br>
between raw/iso and QCOW2 and vice versa is what you see in the code,<br>
and is what is done during migration as Mikal mentioned below.<br>
<div class="im"><br>
> I am fairly new to openstack.<br>
> Can you point me to the specific files in the code where all these<br>
> things are coded. I want to know the details of the<br>
> present state.<br>
<br>
</div>grep for qemu-img in the nova/ directory. You'll see all the files that<br>
call qemu-img commands and then you can go look in those files.<br>
<br>
Best,<br>
-jay<br>
<div class="im"><br>
> Thanks again for your help.<br>
><br>
> Regards,<br>
> Gaurab<br>
><br>
> On Sat, Jul 28, 2012 at 11:52 AM, Michael Still<br>
</div><div><div class="h5">> <<a href="mailto:michael.still@canonical.com">michael.still@canonical.com</a> <mailto:<a href="mailto:michael.still@canonical.com">michael.still@canonical.com</a>>> wrote:<br>
><br>
>     On 28/07/12 05:42, Gaurab Basu wrote:<br>
>     > Hi,<br>
>     ><br>
>     > I am trying to figure out the technology that openstack uses when<br>
>     > multiple VM's having the*same *base image (OS) are provisioned on a<br>
>     > physical server.<br>
>     > Does it use as many copy as the number of VM's or does it use the same<br>
>     > base image and then copy on write.<br>
>     ><br>
>     > I need to understand the complete details. Can anybody share some<br>
>     > details or point me to some place where I can find the details.<br>
><br>
>     Its pretty hard to provide a complete description of what happens,<br>
>     because the code keeps changing. However, assuming you have copy on<br>
>     write turned on (which is the default IIRC), and assuming that all of<br>
>     the instances have the same disk size, then you end up with:<br>
><br>
>      - the image as fetched from glance, with possible format conversion<br>
>      - that image resized to the size the instance requested<br>
>      - a cow on write layer for each instance that is using that sized image<br>
><br>
>     The first should be smallish, the second can be quite large, and the<br>
>     third will really depend on how much writing the instances are doing.<br>
><br>
>     Note that this all falls apart if instances are migrated, because as<br>
>     part of the migration the copy on write layer is transformed into a full<br>
>     disk image, which is what is shipped over to the new machine.<br>
><br>
>     Hope this helps,<br>
>     Mikal<br>
><br>
><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
> Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
> Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
> More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
><br>
<br>
_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/%7Eopenstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
</blockquote></div><br><br clear="all"><br>