[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Running a script on xm create



Hi Adam,

your answer is yes and no.
Using the old "xend" toolstack you could simply do an

import os
os.system("runshit")
at an arbitrary point in the config file.

But this old toolstack was very buggy and hard to maintain why it got
replaced and you're just a few years late to make use of those
features now.

The new one, xl, does not have inline scripting support.
Trust me, that's good, because instead it is fast and a bit more reliable.

What can you do?
Just make a wrapper script around xl create.

(Unless you're working with some abstraction stuff like libvirt that
can't do what a junior admin could do on day2. Then you're doomed but
you can then still use block scripts for that setup. They're a bit
more complex and you'd have to ask on xen-devel I think.

Anyway Xen is very extensible, but please don't start scripting in the
domU config now :)

Florian

2013/1/16 Adam Goryachev <mailinglists@xxxxxxxxxxxxxxxxxxxxxx>:
> Hi,
>
> I was just wondering if it is possible to cause a script to run
> (configured in the domu.cfg file) each time "xm create domu.cfg" is run,
> but before the machine is actually started?
>
> ie, I'd like to "setup" the disks for the VM before xen/qemu tries to
> use the devices and allocate to the domu.
>
> I'm using xen 4.1.3 on Debian testing, and using the xm toolstack.
>
> In particular, I'm allocating a ram drive (/dev/ramX) to the domU, but I
> need to ensure the module is loaded, the ramdrive exists, and also use
> dd to copy the image of the drive into the ramdrive (partition, format,
> and files all in one go), all before the machine bootup commences.
>
> Thanks for any suggestions.
>
> Regards,
> Adam
>
> --
> Adam Goryachev
> Website Managers
> www.websitemanagers.com.au
>
>
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxx
> http://lists.xen.org/xen-users



-- 
the purpose of libvirt is to provide an abstraction layer hiding all
xen features added since 2006 until they were finally understood and
copied by the kvm devs.

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.