FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora/Linux Management Tools

 
 
LinkBack Thread Tools
 
Old 07-14-2008, 06:25 PM
Michael DeHaan
 
Default Idea/help with virt-clone?

Here's something I would like to see, but do not know how to cleanly
accomplish:


virt-clone -o GUESTNAME -f NEWDISKFILE -x NEWXML

The idea here is I really want to be able to clone guests, but I don't
necessarily want to clone them on the same host. Instead, I want to be
able to track a central library of guests (and their associated disk
images) in cobbler that I can clone later -- in my case, koan will be
just doing the bare-minimum to get the virt-image parameters right to
feed to virt-image. So, in order to do this, I also need to get some
XML out of the guest that is compatible with virt-image, so I can save
it on the central server.


The problem I have now is that the XML coming out of virsh dumpxml is
not compatible with virt-image.


This "-x" output would need to be in virt-image format and it would
write this XML in addition to the diskfile.


For example, once established, I could just feed this back into
virt-image like so:


virt-image foo.xml --n NEWNAME -u NEWUUID -m NEWMAC -b NEWBRIDGE

I do not think I'm familiar with virtinst internals to add this, though
it's something we are going to eventually need for ovirt.


You can see a bit of what syntax I'm getting at (and the general idea) here:

https://fedorahosted.org/cobbler/wiki/KoanWithIsos

Though in addition koan would be tracking the xmlfile for cloning info
as well.


--Michael


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-14-2008, 07:35 PM
Cole Robinson
 
Default Idea/help with virt-clone?

Michael DeHaan wrote:
> Here's something I would like to see, but do not know how to cleanly
> accomplish:
>
> virt-clone -o GUESTNAME -f NEWDISKFILE -x NEWXML
>
> The idea here is I really want to be able to clone guests, but I don't
> necessarily want to clone them on the same host. Instead, I want to be
> able to track a central library of guests (and their associated disk
> images) in cobbler that I can clone later -- in my case, koan will be
> just doing the bare-minimum to get the virt-image parameters right to
> feed to virt-image. So, in order to do this, I also need to get some
> XML out of the guest that is compatible with virt-image, so I can save
> it on the central server.
>
> The problem I have now is that the XML coming out of virsh dumpxml is
> not compatible with virt-image.
>
> This "-x" output would need to be in virt-image format and it would
> write this XML in addition to the diskfile.
>
> For example, once established, I could just feed this back into
> virt-image like so:
>
> virt-image foo.xml --n NEWNAME -u NEWUUID -m NEWMAC -b NEWBRIDGE
>
> I do not think I'm familiar with virtinst internals to add this, though
> it's something we are going to eventually need for ovirt.
>
> You can see a bit of what syntax I'm getting at (and the general idea) here:
>
> https://fedorahosted.org/cobbler/wiki/KoanWithIsos
>
> Though in addition koan would be tracking the xmlfile for cloning info
> as well.
>

I think the premise is okay, but from an app separation point
of view it should be achieved a bit differently.

We could add an option to virt-clone to output the libvirt xml of
the new guest. This would be pretty simple to add.

We could then use the new virt-convert tool to convert libvirt xml
to virt-image xml. This functionality isn't present but work is
being done in this area and would not be all that difficult to
add.

This adds an extra step to your proposed process, but I think is
the sensible way to go. Converting libvirt xml to virt-image xml
is desired functionality anyways, so we want to head in this
direction.

- Cole



_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-14-2008, 07:49 PM
Michael DeHaan
 
Default Idea/help with virt-clone?

Cole Robinson wrote:

Michael DeHaan wrote:

Here's something I would like to see, but do not know how to cleanly
accomplish:


virt-clone -o GUESTNAME -f NEWDISKFILE -x NEWXML

The idea here is I really want to be able to clone guests, but I don't
necessarily want to clone them on the same host. Instead, I want to be
able to track a central library of guests (and their associated disk
images) in cobbler that I can clone later -- in my case, koan will be
just doing the bare-minimum to get the virt-image parameters right to
feed to virt-image. So, in order to do this, I also need to get some
XML out of the guest that is compatible with virt-image, so I can save
it on the central server.


The problem I have now is that the XML coming out of virsh dumpxml is
not compatible with virt-image.


This "-x" output would need to be in virt-image format and it would
write this XML in addition to the diskfile.


For example, once established, I could just feed this back into
virt-image like so:


virt-image foo.xml --n NEWNAME -u NEWUUID -m NEWMAC -b NEWBRIDGE

I do not think I'm familiar with virtinst internals to add this, though
it's something we are going to eventually need for ovirt.


You can see a bit of what syntax I'm getting at (and the general idea) here:

https://fedorahosted.org/cobbler/wiki/KoanWithIsos

Though in addition koan would be tracking the xmlfile for cloning info
as well.





I think the premise is okay, but from an app separation point
of view it should be achieved a bit differently.

We could add an option to virt-clone to output the libvirt xml of
the new guest. This would be pretty simple to add.

We could then use the new virt-convert tool to convert libvirt xml
to virt-image xml. This functionality isn't present but work is
being done in this area and would not be all that difficult to
add.

This adds an extra step to your proposed process, but I think is
the sensible way to go. Converting libvirt xml to virt-image xml
is desired functionality anyways, so we want to head in this
direction.

- Cole






Cool.

Just to be sure we're on the same page, do you see this process looking
something like:


virt-clone guestname --dumpxml foo.xml --disk bar.disk && virt-convert
--input foo.xml --dumpxml baz.xml

cp bar.disk /some/nfs_mounted/path/bar.disk
cp foo.xml /some/nfs_mounted/path/foo.xml
cobbler image --name=blip add --disk nfs://.../bar.disk --xml
nfs://.../foo.xml

koan --server=cobbler.example.com --image=blip --virt

The koan command, when run:

(a) copies the xml file from NFS to some directory
(b) copies the disk from NFS to some directory
(c) performs minimal xml surgery to fix up path URLs and replace any mac
addresses the best it can using mac info stored in cobbler or randomly
generated
(d) (if any overrides are in cobbler, like --virt-ram, it may also try
to replace those, though those features are TBD and not really a concern
in the ovirt case)

(e) runs virt-image against tweaked xml file.

Sound good/close?

--Michael

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-14-2008, 07:54 PM
Cole Robinson
 
Default Idea/help with virt-clone?

Michael DeHaan wrote:
> Cole Robinson wrote:
>> Michael DeHaan wrote:
>>
>>> Here's something I would like to see, but do not know how to cleanly
>>> accomplish:
>>>
>>> virt-clone -o GUESTNAME -f NEWDISKFILE -x NEWXML
>>>
>>> The idea here is I really want to be able to clone guests, but I don't
>>> necessarily want to clone them on the same host. Instead, I want to be
>>> able to track a central library of guests (and their associated disk
>>> images) in cobbler that I can clone later -- in my case, koan will be
>>> just doing the bare-minimum to get the virt-image parameters right to
>>> feed to virt-image. So, in order to do this, I also need to get some
>>> XML out of the guest that is compatible with virt-image, so I can save
>>> it on the central server.
>>>
>>> The problem I have now is that the XML coming out of virsh dumpxml is
>>> not compatible with virt-image.
>>>
>>> This "-x" output would need to be in virt-image format and it would
>>> write this XML in addition to the diskfile.
>>>
>>> For example, once established, I could just feed this back into
>>> virt-image like so:
>>>
>>> virt-image foo.xml --n NEWNAME -u NEWUUID -m NEWMAC -b NEWBRIDGE
>>>
>>> I do not think I'm familiar with virtinst internals to add this, though
>>> it's something we are going to eventually need for ovirt.
>>>
>>> You can see a bit of what syntax I'm getting at (and the general idea) here:
>>>
>>> https://fedorahosted.org/cobbler/wiki/KoanWithIsos
>>>
>>> Though in addition koan would be tracking the xmlfile for cloning info
>>> as well.
>>>
>>>
>> I think the premise is okay, but from an app separation point
>> of view it should be achieved a bit differently.
>>
>> We could add an option to virt-clone to output the libvirt xml of
>> the new guest. This would be pretty simple to add.
>>
>> We could then use the new virt-convert tool to convert libvirt xml
>> to virt-image xml. This functionality isn't present but work is
>> being done in this area and would not be all that difficult to
>> add.
>>
>> This adds an extra step to your proposed process, but I think is
>> the sensible way to go. Converting libvirt xml to virt-image xml
>> is desired functionality anyways, so we want to head in this
>> direction.
>>
>> - Cole
>>
>>
>>
>>
>
> Cool.
>
> Just to be sure we're on the same page, do you see this process looking
> something like:
>
> virt-clone guestname --dumpxml foo.xml --disk bar.disk && virt-convert
> --input foo.xml --dumpxml baz.xml
> cp bar.disk /some/nfs_mounted/path/bar.disk
> cp foo.xml /some/nfs_mounted/path/foo.xml
> cobbler image --name=blip add --disk nfs://.../bar.disk --xml
> nfs://.../foo.xml
> koan --server=cobbler.example.com --image=blip --virt
>

Yeah as far as I can imagine that seems about right.

> The koan command, when run:
>
> (a) copies the xml file from NFS to some directory
> (b) copies the disk from NFS to some directory
> (c) performs minimal xml surgery to fix up path URLs and replace any mac
> addresses the best it can using mac info stored in cobbler or randomly
> generated

Actually the nature of the virt-image format is that you shouldn't
need to do any xml surgery, it is (ideally) completely portable. Specific
things like memory amounts and mac addresses are specified at the time
virt-image is called: see virt-image --help for all the goodies that
can be specified.

> (d) (if any overrides are in cobbler, like --virt-ram, it may also try
> to replace those, though those features are TBD and not really a concern
> in the ovirt case)
> (e) runs virt-image against tweaked xml file.
>
> Sound good/close?
>
> --Michael

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-14-2008, 08:01 PM
Bryan Kearney
 
Default Idea/help with virt-clone?

Actually the nature of the virt-image format is that you shouldn't
need to do any xml surgery, it is (ideally) completely portable. Specific
things like memory amounts and mac addresses are specified at the time
virt-image is called: see virt-image --help for all the goodies that
can be specified.
tools
But ideally, the initial virt image xml would contain the memory and cpu
settings from the source system.. since that is as close to a template
as we have.


-- bk

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-14-2008, 08:08 PM
Michael DeHaan
 
Default Idea/help with virt-clone?

Cole Robinson wrote:

Michael DeHaan wrote:


Cole Robinson wrote:


Michael DeHaan wrote:


Here's something I would like to see, but do not know how to cleanly
accomplish:


virt-clone -o GUESTNAME -f NEWDISKFILE -x NEWXML

The idea here is I really want to be able to clone guests, but I don't
necessarily want to clone them on the same host. Instead, I want to be
able to track a central library of guests (and their associated disk
images) in cobbler that I can clone later -- in my case, koan will be
just doing the bare-minimum to get the virt-image parameters right to
feed to virt-image. So, in order to do this, I also need to get some
XML out of the guest that is compatible with virt-image, so I can save
it on the central server.


The problem I have now is that the XML coming out of virsh dumpxml is
not compatible with virt-image.


This "-x" output would need to be in virt-image format and it would
write this XML in addition to the diskfile.


For example, once established, I could just feed this back into
virt-image like so:


virt-image foo.xml --n NEWNAME -u NEWUUID -m NEWMAC -b NEWBRIDGE

I do not think I'm familiar with virtinst internals to add this, though
it's something we are going to eventually need for ovirt.


You can see a bit of what syntax I'm getting at (and the general idea) here:

https://fedorahosted.org/cobbler/wiki/KoanWithIsos

Though in addition koan would be tracking the xmlfile for cloning info
as well.





I think the premise is okay, but from an app separation point
of view it should be achieved a bit differently.

We could add an option to virt-clone to output the libvirt xml of
the new guest. This would be pretty simple to add.

We could then use the new virt-convert tool to convert libvirt xml
to virt-image xml. This functionality isn't present but work is
being done in this area and would not be all that difficult to
add.

This adds an extra step to your proposed process, but I think is
the sensible way to go. Converting libvirt xml to virt-image xml
is desired functionality anyways, so we want to head in this
direction.

- Cole






Cool.

Just to be sure we're on the same page, do you see this process looking
something like:


virt-clone guestname --dumpxml foo.xml --disk bar.disk && virt-convert
--input foo.xml --dumpxml baz.xml

cp bar.disk /some/nfs_mounted/path/bar.disk
cp foo.xml /some/nfs_mounted/path/foo.xml
cobbler image --name=blip add --disk nfs://.../bar.disk --xml
nfs://.../foo.xml

koan --server=cobbler.example.com --image=blip --virt




Yeah as far as I can imagine that seems about right.



The koan command, when run:

(a) copies the xml file from NFS to some directory
(b) copies the disk from NFS to some directory
(c) performs minimal xml surgery to fix up path URLs and replace any mac
addresses the best it can using mac info stored in cobbler or randomly
generated



Actually the nature of the virt-image format is that you shouldn't
need to do any xml surgery, it is (ideally) completely portable. Specific
things like memory amounts and mac addresses are specified at the time
virt-image is called: see virt-image --help for all the goodies that
can be specified.


That's even better. So it is possible to reuse --disk and --mac for
multiple disks/macs, then?



(d) (if any overrides are in cobbler, like --virt-ram, it may also try
to replace those, though those features are TBD and not really a concern
in the ovirt case)

(e) runs virt-image against tweaked xml file.

Sound good/close?

--Michael






_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-14-2008, 08:13 PM
Cole Robinson
 
Default Idea/help with virt-clone?

Bryan Kearney wrote:
>> Actually the nature of the virt-image format is that you shouldn't
>> need to do any xml surgery, it is (ideally) completely portable. Specific
>> things like memory amounts and mac addresses are specified at the time
>> virt-image is called: see virt-image --help for all the goodies that
>> can be specified.
>> tools
> But ideally, the initial virt image xml would contain the memory and cpu
> settings from the source system.. since that is as close to a template
> as we have.
>
> -- bk
>

Oh, yes that's true. I forgot that mem and vcpu recommendations can be
in the image xml. Thankfully though the virt-image removes any need
to manually alter xml.

- Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-14-2008, 08:14 PM
Michael DeHaan
 
Default Idea/help with virt-clone?

Bryan Kearney wrote:




Actually the nature of the virt-image format is that you shouldn't
need to do any xml surgery, it is (ideally) completely portable.
Specific

things like memory amounts and mac addresses are specified at the time
virt-image is called: see virt-image --help for all the goodies that
can be specified.
tools
But ideally, the initial virt image xml would contain the memory and
cpu settings from the source system.. since that is as close to a
template as we have.


-- bk


Yes, we'd want that if it's not already there.

In the cobbler use case, I can see defaulting --virt-ram (in cobbler) to
"", which would mean, "use what is in the file", but more often than not
someone is going to want to tweak it up or down.


For instance:

cobbler image copy --name=image --newname=image-with-more-ram
--virt-ram=1024


This makes an image object like image-with-more-ram (keeping the behind
the scenes XML the same), but when invoked with koan, grants more RAM to
the system than was originally requested.


This is basically how all the overrides in cobbler work today and makes
things easy to edit in the web app.


Currently non-image based guests default to a ram value in
/etc/cobbler/settings when they are created without specificing a limit.


Anyhow, as long as we have all the flags on --virt-image so we don't
have to override the XML, and make it very easy to /get/ that XML, I'm
happy and can start working on this shortly ... we can just wait for the
tools to prepare that to come along and add them to the docs/process later.


--Michael


_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-14-2008, 08:19 PM
Cole Robinson
 
Default Idea/help with virt-clone?

Michael DeHaan wrote:
> Cole Robinson wrote:
>> Michael DeHaan wrote:
>>
>>> The koan command, when run:
>>>
>>> (a) copies the xml file from NFS to some directory
>>> (b) copies the disk from NFS to some directory
>>> (c) performs minimal xml surgery to fix up path URLs and replace any mac
>>> addresses the best it can using mac info stored in cobbler or randomly
>>> generated
>>>
>> Actually the nature of the virt-image format is that you shouldn't
>> need to do any xml surgery, it is (ideally) completely portable. Specific
>> things like memory amounts and mac addresses are specified at the time
>> virt-image is called: see virt-image --help for all the goodies that
>> can be specified.
>>
>>
> That's even better. So it is possible to reuse --disk and --mac for
> multiple disks/macs, then?
>
>

I'm a bit confused: are you talking cobbler/koan options or virt-image
options? If the latter, there is no --disk option, since it pulls all
that info from the image xml. Multiple --network and --mac options
can be specified though.

- Cole

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 
Old 07-14-2008, 08:34 PM
Michael DeHaan
 
Default Idea/help with virt-clone?

Cole Robinson wrote:

Michael DeHaan wrote:


Cole Robinson wrote:


Michael DeHaan wrote:



The koan command, when run:

(a) copies the xml file from NFS to some directory
(b) copies the disk from NFS to some directory
(c) performs minimal xml surgery to fix up path URLs and replace any mac
addresses the best it can using mac info stored in cobbler or randomly
generated



Actually the nature of the virt-image format is that you shouldn't
need to do any xml surgery, it is (ideally) completely portable. Specific
things like memory amounts and mac addresses are specified at the time
virt-image is called: see virt-image --help for all the goodies that
can be specified.



That's even better. So it is possible to reuse --disk and --mac for
multiple disks/macs, then?






I'm a bit confused: are you talking cobbler/koan options or virt-image
options? If the latter, there is no --disk option, since it pulls all
that info from the image xml. Multiple --network and --mac options
can be specified though.

- Cole



virt-image options.

And you're right on disks




_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@redhat.com
https://www.redhat.com/mailman/listinfo/et-mgmt-tools
 

Thread Tools




All times are GMT. The time now is 10:38 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org