Skip to contentSkip to conversation

Tool to migrate xm/xend managed domains into xl.cfg files

DISCUSSION Stefan Bader 4 participants 7 messages Apr 2, 2014

lore
Share & tools
lore
#0 lore raw

Does anybody have such a tool which could be shared? I know with a recent patch in libvirt (1.2.3~rc1) it is possible to create libvirt xml files from the config.sxp ones.
Just was wondering whether there might be a need of having something similar for those that used to use xm/xend managed domains without anything else than the xen-utils.

-Stefan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#1 lore raw
Quoted 7 lines · Stefan Bader

Does anybody have such a tool which could be shared? I know with a recent patch in libvirt (1.2.3~rc1) it is possible to create libvirt xml files from the config.sxp ones.
Just was wondering whether there might be a need of having something similar for those that used to use xm/xend managed domains without anything else than the xen-utils.

With libvirt you can do at least:

virsh dumpxml vm_name > /tmp/a.xml
virsh domxml-to-native xen-xm /tmp/a.xml > vmname.cfg

Which gives you xm/xend text config files.. which should be mostly compatible with xl cfgfiles.

Quoted 2 lines

-Stefan

-- Pasi

#2 lore raw
Quoted 9 lines · Pasi Kärkkäinen
Quoted 7 lines · Stefan Bader

Does anybody have such a tool which could be shared? I know with a recent patch in libvirt (1.2.3~rc1) it is possible to create libvirt xml files from the config.sxp ones.
Just was wondering whether there might be a need of having something similar for those that used to use xm/xend managed domains without anything else than the xen-utils.

Quoted 6 lines

With libvirt you can do at least:

virsh dumpxml vm_name > /tmp/a.xml
virsh domxml-to-native xen-xm /tmp/a.xml > vmname.cfg

Which gives you xm/xend text config files.. which should be mostly compatible with xl cfgfiles.

Right, you also could do a domxml-from-native xen-sxpr <file> and re-export that with domxml-to-native xen-xm as you said.
The reason I am asking or looking into it is trying to figure out whether I can offer a nice way of don some of that automatically for people on upgrade (and there might be some that don't have libvirt installed as well).

Quoted 6 lines
Quoted 3 lines

-Stefan

-- Pasi

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#3 lore raw
Quoted 15 lines · Stefan Bader
Quoted 14 lines · Pasi Kärkkäinen
Quoted 7 lines · Stefan Bader

Does anybody have such a tool which could be shared? I know with a recent patch in libvirt (1.2.3~rc1) it is possible to create libvirt xml files from the config.sxp ones.
Just was wondering whether there might be a need of having something similar for those that used to use xm/xend managed domains without anything else than the xen-utils.

With libvirt you can do at least:

virsh dumpxml vm_name > /tmp/a.xml
virsh domxml-to-native xen-xm /tmp/a.xml > vmname.cfg

Quoted 7 lines
Quoted 1 line

Which gives you xm/xend text config files.. which should be mostly compatible with xl cfgfiles.

Right, you also could do a domxml-from-native xen-sxpr <file> and re-export that with domxml-to-native xen-xm as you said.
The reason I am asking or looking into it is trying to figure out whether I can offer a nice way of don some of that automatically for people on upgrade (and there might be some that don't have libvirt installed as well).

Would users really want that translation done automatically? I'd rather be told how to do it myself so I can check the outcome; but maybe I'm a bit strange that way. :-)

In theory it seems like someone who knew what they were doing with python should be able to rip out the sxp parsing stuff from xend, and then once you had a structure with all the configuration in it, write that out into a .cfg file. I'm sure that would be a useful tool to have in-tree, particularly if we manage to actually get rid of xend this release cycle.

-George

#4 lore raw
Quoted 24 lines · George Dunlap
Quoted 15 lines · Stefan Bader
Quoted 14 lines · Pasi Kärkkäinen
Quoted 7 lines · Stefan Bader

Does anybody have such a tool which could be shared? I know with a recent patch in libvirt (1.2.3~rc1) it is possible to create libvirt xml files from the config.sxp ones.
Just was wondering whether there might be a need of having something similar for those that used to use xm/xend managed domains without anything else than the xen-utils.

With libvirt you can do at least:

virsh dumpxml vm_name > /tmp/a.xml
virsh domxml-to-native xen-xm /tmp/a.xml > vmname.cfg

Quoted 7 lines
Quoted 1 line

Which gives you xm/xend text config files.. which should be mostly compatible with xl cfgfiles.

Right, you also could do a domxml-from-native xen-sxpr <file> and re-export that with domxml-to-native xen-xm as you said.
The reason I am asking or looking into it is trying to figure out whether I can offer a nice way of don some of that automatically for people on upgrade (and there might be some that don't have libvirt installed as well).

Quoted 3 lines

Would users really want that translation done automatically? I'd rather be told how to do it myself so I can check the outcome; but maybe I'm a bit strange that way. :-)

I would only create files of a certain name if they do not exist. :)

Quoted 7 lines

In theory it seems like someone who knew what they were doing with python should be able to rip out the sxp parsing stuff from xend, and then once you had a structure with all the configuration in it, write that out into a .cfg file. I'm sure that would be a useful tool to have in-tree, particularly if we manage to actually get rid of xend this release cycle.

Yeah, that is exactly wht I started off. It is a bit erm difficult to dig into it and I might be missing the easy why of getting the output from the list of domains' XendConfig objects. But basically thats where I am right now and just wanted to ensure I am not inventing yet another wheel.
If I get something I am happy with I'll let the list know. :)

-Stefan

Quoted 3 lines

-George

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#5 lore raw
In reply to George Dunlap
Quoted 24 lines · George Dunlap
Quoted 15 lines · Stefan Bader
Quoted 14 lines · Pasi Kärkkäinen
Quoted 7 lines · Stefan Bader

Does anybody have such a tool which could be shared? I know with a recent patch in libvirt (1.2.3~rc1) it is possible to create libvirt xml files from the config.sxp ones.
Just was wondering whether there might be a need of having something similar for those that used to use xm/xend managed domains without anything else than the xen-utils.

With libvirt you can do at least:

virsh dumpxml vm_name > /tmp/a.xml
virsh domxml-to-native xen-xm /tmp/a.xml > vmname.cfg

Quoted 7 lines
Quoted 1 line

Which gives you xm/xend text config files.. which should be mostly compatible with xl cfgfiles.

Right, you also could do a domxml-from-native xen-sxpr <file> and re-export that with domxml-to-native xen-xm as you said.
The reason I am asking or looking into it is trying to figure out whether I can offer a nice way of don some of that automatically for people on upgrade (and there might be some that don't have libvirt installed as well).

Quoted 6 lines

Would users really want that translation done automatically? I'd rather be told how to do it myself so I can check the outcome; but maybe I'm a bit strange that way. :-)

In theory it seems like someone who knew what they were doing with python should be able to rip out the sxp parsing stuff from xend,

Does xend store its managed domains as sxp? I thought I'd seem piles of XML relating to the XenAPI (== managed domains) under /var somewhere...

Ian.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#6 lore raw
Quoted 29 lines · Ian Campbell
Quoted 28 lines · George Dunlap
Quoted 15 lines · Stefan Bader
Quoted 14 lines · Pasi Kärkkäinen
Quoted 7 lines · Stefan Bader

Does anybody have such a tool which could be shared? I know with a recent patch in libvirt (1.2.3~rc1) it is possible to create libvirt xml files from the config.sxp ones.
Just was wondering whether there might be a need of having something similar for those that used to use xm/xend managed domains without anything else than the xen-utils.

With libvirt you can do at least:

virsh dumpxml vm_name > /tmp/a.xml
virsh domxml-to-native xen-xm /tmp/a.xml > vmname.cfg

Quoted 7 lines
Quoted 1 line

Which gives you xm/xend text config files.. which should be mostly compatible with xl cfgfiles.

Right, you also could do a domxml-from-native xen-sxpr <file> and re-export that with domxml-to-native xen-xm as you said.
The reason I am asking or looking into it is trying to figure out whether I can offer a nice way of don some of that automatically for people on upgrade (and there might be some that don't have libvirt installed as well).

Would users really want that translation done automatically? I'd rather be told how to do it myself so I can check the outcome; but maybe I'm a bit strange that way. :-)

Quoted 8 lines
Quoted 2 lines

In theory it seems like someone who knew what they were doing with python should be able to rip out the sxp parsing stuff from xend,

Does xend store its managed domains as sxp? I thought I'd seem piles of XML relating to the XenAPI (== managed domains) under /var somewhere...

Ian.

There is a bit of that but the files themselves /var/lib/xend/domains/<uuid>/config.sxp are sxp. And for something useful only with a basic xen install the output should be xm format. Libvirt uses some kind of xml but we are in a better place there as import export functions are easy to access. There is only one minor oddness right now that you end up with an xml that defines a vif#.# interface as a target for a bridge but its simple to grep that away.

-Stefan

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel