[Engine-devel] Disk Cloning When Creating a VM via a Template

--_000_0A1534657992624AACDCA570F1D3E20003C29F05SACEXCMBX03PRDh_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Greetings, I know that floating disks are coming in the next version of oVirt, but in = the interim I want to know internally what the procedure is when a disk is = cloned when creating a VM from a template. I see the AddVmImages() method = in the AddVmFromTemplateCommand.java file, but could someone walk me throug= h exactly what is going on when the disk gets cloned? Thanks! -- Dustin --_000_0A1534657992624AACDCA570F1D3E20003C29F05SACEXCMBX03PRDh_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr= osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:= //www.w3.org/TR/REC-html40"> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
<meta name=3D"Generator" content=3D"Microsoft Word 14 (filtered medium)"> <style><!-- /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:11.0pt; font-family:"Calibri","sans-serif";} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:purple; text-decoration:underline;} span.EmailStyle17 {mso-style-type:personal-compose; font-family:"Calibri","sans-serif"; color:windowtext;} .MsoChpDefault {mso-style-type:export-only; font-family:"Calibri","sans-serif";} @page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in;} div.WordSection1 {page:WordSection1;} --></style><!--[if gte mso 9]><xml> <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=3D"edit"> <o:idmap v:ext=3D"edit" data=3D"1" /> </o:shapelayout></xml><![endif]--> </head> <body lang=3D"EN-US" link=3D"blue" vlink=3D"purple"> <div class=3D"WordSection1"> <p class=3D"MsoNormal">Greetings,<o:p></o:p></p> <p class=3D"MsoNormal"><o:p> </o:p></p> <p class=3D"MsoNormal">I know that floating disks are coming in the next ve= rsion of oVirt, but in the interim I want to know internally what the proce= dure is when a disk is cloned when creating a VM from a template. I s= ee the AddVmImages() method in the AddVmFromTemplateCommand.java file, but could someone walk me through exactly what is going on when the = disk gets cloned? Thanks!<o:p></o:p></p> <p class=3D"MsoNormal"><o:p> </o:p></p> <p class=3D"MsoNormal">-- Dustin<o:p></o:p></p> <p class=3D"MsoNormal"><o:p> </o:p></p> </div> </body> </html> --_000_0A1534657992624AACDCA570F1D3E20003C29F05SACEXCMBX03PRDh_--

On 26/04/12 22:24, Schoenbrun, Dustin wrote:
I know that floating disks are coming in the next version of oVirt, but in the interim I want to know internally what the procedure is when a disk is cloned when creating a VM from a template.
Hi, Today when creating a VM from template the user can choose the provisioning method: - It can be 'Thin' in which the engine is taking a snapshot of the template disks (running AddVMCommand which executes CreateSnapshotFromTemplateCommand) - Or 'Clone' which results in cloning the template disks (executes AddVmFromTemplateCommand which in turn executes CreateCloneOfTemplateCommand) Thanks, Livnat

----- Original Message -----
On 26/04/12 22:24, Schoenbrun, Dustin wrote:
I know that floating disks are coming in the next version of oVirt, but in the interim I want to know internally what the procedure is when a disk is cloned when creating a VM from a template.
I'm not sure what floating disks have to do with it (it would be relevant for cloning a single disk, not cloning an entire VM). For cloning a single disk I believe that floating disk is already available in master by the way.
Hi,
Today when creating a VM from template the user can choose the provisioning method: - It can be 'Thin' in which the engine is taking a snapshot of the template disks (running AddVMCommand which executes CreateSnapshotFromTemplateCommand) - Or 'Clone' which results in cloning the template disks (executes AddVmFromTemplateCommand which in turn executes CreateCloneOfTemplateCommand)
For createCloneOfTemplateCommand, other than the VM configuration being copied, the engine creates copies of all of the template images (calls moveImage in vdsm per Image).
Thanks, Livnat _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

Okay, I'll have a look at master and play around with things a little bit. Thanks for that insight, Ayal! So, when a VM is cloned from a template, all disks associated with the template are cloned to go with the new VM, correct? Could I do something similar with the floating disks and just clone all of the associated disks from a VM? In the meantime, I'll read up a bit more on Floating Disks on the feature pages on the wiki. Thanks again! -- Dustin -----Original Message----- From: Ayal Baron [mailto:abaron@redhat.com] Sent: Sunday, April 29, 2012 6:25 AM To: Livnat Peer Cc: engine-devel@ovirt.org; Schoenbrun, Dustin Subject: Re: [Engine-devel] Disk Cloning When Creating a VM via a Template ----- Original Message -----
On 26/04/12 22:24, Schoenbrun, Dustin wrote:
I know that floating disks are coming in the next version of oVirt, but in the interim I want to know internally what the procedure is when a disk is cloned when creating a VM from a template.
I'm not sure what floating disks have to do with it (it would be relevant for cloning a single disk, not cloning an entire VM). For cloning a single disk I believe that floating disk is already available in master by the way.
Hi,
Today when creating a VM from template the user can choose the provisioning method: - It can be 'Thin' in which the engine is taking a snapshot of the template disks (running AddVMCommand which executes CreateSnapshotFromTemplateCommand) - Or 'Clone' which results in cloning the template disks (executes AddVmFromTemplateCommand which in turn executes CreateCloneOfTemplateCommand)
For createCloneOfTemplateCommand, other than the VM configuration being copied, the engine creates copies of all of the template images (calls moveImage in vdsm per Image).
Thanks, Livnat _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message -----
Okay, I'll have a look at master and play around with things a little bit. Thanks for that insight, Ayal! So, when a VM is cloned from a template, all disks associated with the template are cloned to go with the new VM, correct? Could I do something similar with the floating disks and just clone all of the associated disks from a VM?
I think there is some misunderstanding here. A floating disk is a disk which is not associated with any VM, so what are all of the associated disks? The only place where different disks have any relation to each other us within the context of a VM. Note that if you clone while engine thinks you're creating a qcow snapshot then you'd need to handle merge (snapshot delete) differently as well
In the meantime, I'll read up a bit more on Floating Disks on the feature pages on the wiki. Thanks again!
-- Dustin
-----Original Message----- From: Ayal Baron [mailto:abaron@redhat.com] Sent: Sunday, April 29, 2012 6:25 AM To: Livnat Peer Cc: engine-devel@ovirt.org; Schoenbrun, Dustin Subject: Re: [Engine-devel] Disk Cloning When Creating a VM via a Template
----- Original Message -----
On 26/04/12 22:24, Schoenbrun, Dustin wrote:
I know that floating disks are coming in the next version of oVirt, but in the interim I want to know internally what the procedure is when a disk is cloned when creating a VM from a template.
I'm not sure what floating disks have to do with it (it would be relevant for cloning a single disk, not cloning an entire VM). For cloning a single disk I believe that floating disk is already available in master by the way.
Hi,
Today when creating a VM from template the user can choose the provisioning method: - It can be 'Thin' in which the engine is taking a snapshot of the template disks (running AddVMCommand which executes CreateSnapshotFromTemplateCommand) - Or 'Clone' which results in cloning the template disks (executes AddVmFromTemplateCommand which in turn executes CreateCloneOfTemplateCommand)
For createCloneOfTemplateCommand, other than the VM configuration being copied, the engine creates copies of all of the template images (calls moveImage in vdsm per Image).
Thanks, Livnat _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
participants (3)
-
Ayal Baron
-
Livnat Peer
-
Schoenbrun, Dustin