Hi, I''m working on the early design stages of a multi-dom0 xen monitoring tool, (to replace my previous attempt "Argo"). One thing that would be very useful for a monitoring tool would be the ability to run a script, or scripts, upon dom0 events: domU creation domU shutdown Ideally /etc/xen/events/domU-up.d/* + domU-down.d/* or similar. (Running every executable the appropriate directory with a single argument of the domain name would be sufficient for my purposes.) I''ve managed to write simple behavior for this by hacking /etc/xen/scripts/vif-common.sh. I can detect startup/shutdown by looking at the first command line argument. From there I can examine $XENBUS_PATH to get the ID of the domain which is being created/destroyed - however there isn''t a simple mechanism that I''ve seen to get the domain name. So two questions: 1. Is there a simple method to get the domain name from the ID, short of parsing "xm list N"? 2. Would this kind of startup/shutdown hook be useful to others, and if so would a patch be applied? (I''m happy to submit my code.) Steve -- http://www.steve.org.uk/ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Mon, Mar 05, 2007 at 09:45:29PM +0000, Steve Kemp wrote:> > So two questions: > > 1. Is there a simple method to get the domain name > from the ID, short of parsing "xm list N"?Hi Steve I think what you might be looking for is: xenstore-read ${XENBUS_PATH}/domain If you take a look at the output of xenstore-ls you''ll see there is a whole tree of data that can be queried. Pretty useful!> > 2. Would this kind of startup/shutdown hook be useful > to others, and if so would a patch be applied? (I''m > happy to submit my code.)I''m too new to xen to offer a useful opinion on this one. Sorry. Dig you''re tutorials over at debian-administration! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Mon, Mar 05, 2007 at 10:25:12PM +0000, jez wrote:> I think what you might be looking for is: > xenstore-read ${XENBUS_PATH}/domainCheers, that works beautifully.> Dig you''re tutorials over at debian-administration!Thanks :) Steve -- _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Mon, 2007-03-05 at 21:45 +0000, Steve Kemp wrote:> So two questions: > > 1. Is there a simple method to get the domain name > from the ID, short of parsing "xm list N"?Someone else suggested xenstore, you can also get this from libxenstat.. however xenstore would be your best bet if done in scripts.> > 2. Would this kind of startup/shutdown hook be useful > to others, and if so would a patch be applied? (I''m > happy to submit my code.) >Positively. For a couple of reasons : 1 - Ideally any "interconnect" built around Xen is 100% transparent. By transparent I mean it uses absolutely *no* blocking calls and non blocking sockets to get its work done. The interconnect should not add to the time it takes to distribute work in cpu seconds. This becomes easier if dom-0 was trained to let a central system know of every event, so that an interconnect doesn''t have to wait around to see if a call indeed worked. It could, but it doesn''t *have* to. Lack of a reply by dom-0 in xx minutes indicates a problem. So see, in this case, you really can document and use a negative. A good example of this - If you reboot a dom-u or shut one down, you would have to make your script go into a loop watching xm list or syslog to see when indeed the dom-u finally exited. Signaling on events fixes that. Again, in this case a lack of a notification is meaningful. 2 - we have been working on a monitoring system that can handle 100k + individual dom-0 machines. The only way to effectively do this is to put some kind of triage in place so the most active servers get polled first and distribute the monitoring tasks amongst a few guests. Dom-0 signaling that there is activity helps tune this triage so idle systems get polled last. Any time dom-0 can be made more proactive in the centralization process, the better, imho. I''d be likely to use the patch even if it was rejected.> SteveBest, --Tim _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Tue, Mar 06, 2007 at 10:45:54AM +0800, Tim Post wrote:> Positively. For a couple of reasons :Cool.> Lack of a reply by dom-0 in xx minutes indicates a problem. So see, in > this case, you really can document and use a negative.Agreed.> I''d be likely to use the patch even if it was rejected.Attached to this mail. Two quick comments - I''m not sure if "run-parts" is available in non-Debian distributions, so if it isn''t that needs to be replaced with a simple glob and execute loop, probably in xen-script-common.sh. Secondly vif-common.sh really isn''t the best place to put the code since it isn''t really related to vifs - it was just a convenient place to hang the test, since it is included in vif-bridge, vif-nat, and vif-route. Steve -- http://www.steve.org.uk/ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Hi all. Few days ago I''ve created a domU with windows XP and two file: one for the primary disk, the second one for an additional disk. Now I''ve the problem that I must recover two doc file that are in the second disk of domU (formatted in NTFS). I''ve tried to mount "disk2.img" with "mount -o loop -t ntfs disk2.img" but it say that is not a superblock device and filesystem is wrong. I can''t restart my domU because qemu-dm (and also qemu) say "could not initialize SDL - exiting". I''ve xen (3.0.3.1) installed in Debian. Ideas? Thanks, Carlo I''m really interested to mount and recover some files from disk2.img... _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> -----Original Message----- > From: xen-users-bounces@lists.xensource.com > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of > Carlo Granisso > Sent: 06 March 2007 11:36 > To: xen-users@lists.xensource.com > Subject: [Xen-users] MOUNT PROBLEM > > Hi all. > Few days ago I''ve created a domU with windows XP and two > file: one for the > primary disk, the second one for an additional disk. > > Now I''ve the problem that I must recover two doc file that > are in the second > disk of domU (formatted in NTFS). > I''ve tried to mount "disk2.img" with "mount -o loop -t ntfs > disk2.img" but > it say that is not a superblock device and filesystem is wrong.You probably need to add an offset to cover the header information that QEMU adds to the file. I''m not quite sure how large this offset is.> > I can''t restart my domU because qemu-dm (and also qemu) say "could not > initialize SDL - exiting".You need to have SDL instaled on your machine (or use VNC) to be able to use SDL. I don''t know what package it is for Debian, but on rpm-based solutions, there''s a SDL-<ver>.i386.rpm that you need to install to be able to use SDL - this must be installed on the TARGET system, and it''s most likely not included in the Xen package for Debian.> I''ve xen (3.0.3.1) installed in Debian. > > Ideas? > > Thanks, > > > Carlo > > I''m really interested to mount and recover some files from > disk2.img... > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
The "lomount" utility lets you specify a partition for loopack mounting in a full-disk image file. It''s available in tools/misc in the current xen-unstable sources, but I''m not sure whether the pre-built or distro-packaged versions of xen have it bundled yet. On 3/6/07, Carlo Granisso <carlo@granisso.it> wrote:> > Hi all. > Few days ago I''ve created a domU with windows XP and two file: one for the > primary disk, the second one for an additional disk. > > Now I''ve the problem that I must recover two doc file that are in the > second > disk of domU (formatted in NTFS). > I''ve tried to mount "disk2.img" with "mount -o loop -t ntfs disk2.img" but > it say that is not a superblock device and filesystem is wrong. > > I can''t restart my domU because qemu-dm (and also qemu) say "could not > initialize SDL - exiting". > I''ve xen (3.0.3.1) installed in Debian. > > Ideas? > > Thanks, > > > Carlo > > I''m really interested to mount and recover some files from disk2.img... > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
I think that you''re the best... Lomount work fine! If I''ve time I will try to recover my domU, but second disk now mounted! Thanks! -----Messaggio originale----- Da: Petersson, Mats [mailto:Mats.Petersson@amd.com] Inviato: martedì 6 marzo 2007 12.44 A: Carlo Granisso; xen-users@lists.xensource.com Oggetto: RE: [Xen-users] MOUNT PROBLEM> -----Original Message----- > From: xen-users-bounces@lists.xensource.com > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of > Carlo Granisso > Sent: 06 March 2007 11:36 > To: xen-users@lists.xensource.com > Subject: [Xen-users] MOUNT PROBLEM > > Hi all. > Few days ago I''ve created a domU with windows XP and two > file: one for the > primary disk, the second one for an additional disk. > > Now I''ve the problem that I must recover two doc file that > are in the second > disk of domU (formatted in NTFS). > I''ve tried to mount "disk2.img" with "mount -o loop -t ntfs > disk2.img" but > it say that is not a superblock device and filesystem is wrong.You probably need to add an offset to cover the header information that QEMU adds to the file. I''m not quite sure how large this offset is.> > I can''t restart my domU because qemu-dm (and also qemu) say "could not > initialize SDL - exiting".You need to have SDL instaled on your machine (or use VNC) to be able to use SDL. I don''t know what package it is for Debian, but on rpm-based solutions, there''s a SDL-<ver>.i386.rpm that you need to install to be able to use SDL - this must be installed on the TARGET system, and it''s most likely not included in the Xen package for Debian.> I''ve xen (3.0.3.1) installed in Debian. > > Ideas? > > Thanks, > > > Carlo > > I''m really interested to mount and recover some files from > disk2.img... > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Now with QEMU I have: qemu -boot c -hda win.img -no-kqemu ---------------------- DirectFB v0.9.25 --------------------- (c) 2000-2002 convergence integrated media GmbH (c) 2002-2004 convergence GmbH ----------------------------------------------------------- (*) DirectFB/Core: Single Application Core. (2007-02-28 23:33) (*) Direct/Memcpy: Using MMXEXT optimized memcpy() (!) Direct/Util: opening ''/dev/fb0'' failed --> No such device (!) DirectFB/FBDev: Error opening framebuffer device! (!) DirectFB/FBDev: Use ''fbdev'' option or set FRAMEBUFFER environment variable. (!) DirectFB/Core: Could not initialize ''system'' core! --> Initialization error! Could not initialize SDL - exiting I''ve create /dev/fb0 with mknod but the message is the same... Ideas? Thanks! -----Messaggio originale----- Da: Petersson, Mats [mailto:Mats.Petersson@amd.com] Inviato: martedì 6 marzo 2007 12.44 A: Carlo Granisso; xen-users@lists.xensource.com Oggetto: RE: [Xen-users] MOUNT PROBLEM> -----Original Message----- > From: xen-users-bounces@lists.xensource.com > [mailto:xen-users-bounces@lists.xensource.com] On Behalf Of > Carlo Granisso > Sent: 06 March 2007 11:36 > To: xen-users@lists.xensource.com > Subject: [Xen-users] MOUNT PROBLEM > > Hi all. > Few days ago I''ve created a domU with windows XP and two > file: one for the > primary disk, the second one for an additional disk. > > Now I''ve the problem that I must recover two doc file that > are in the second > disk of domU (formatted in NTFS). > I''ve tried to mount "disk2.img" with "mount -o loop -t ntfs > disk2.img" but > it say that is not a superblock device and filesystem is wrong.You probably need to add an offset to cover the header information that QEMU adds to the file. I''m not quite sure how large this offset is.> > I can''t restart my domU because qemu-dm (and also qemu) say "could not > initialize SDL - exiting".You need to have SDL instaled on your machine (or use VNC) to be able to use SDL. I don''t know what package it is for Debian, but on rpm-based solutions, there''s a SDL-<ver>.i386.rpm that you need to install to be able to use SDL - this must be installed on the TARGET system, and it''s most likely not included in the Xen package for Debian.> I''ve xen (3.0.3.1) installed in Debian. > > Ideas? > > Thanks, > > > Carlo > > I''m really interested to mount and recover some files from > disk2.img... > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > > >_______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Mark Williamson
2007-Mar-06 14:38 UTC
Re: [Xen-users] Running scripts on domU create/shutdown?
Hi, Steve,> I''m working on the early design stages of a multi-dom0 xen > monitoring tool, (to replace my previous attempt "Argo").Ah cool. Argo looked quite funky to me, so it''ll be interesting to see what you come up with. Do you have a particular use case in mind that you''re making this for?> One thing that would be very useful for a monitoring tool > would be the ability to run a script, or scripts, upon > dom0 events: > > domU creation > domU shutdownI''ve now replied to your e-mail commenting on technical issues on the xen-devel list. Cheers, Mark> Ideally /etc/xen/events/domU-up.d/* + domU-down.d/* or > similar. (Running every executable the appropriate directory > with a single argument of the domain name would be sufficient > for my purposes.) > > I''ve managed to write simple behavior for this by hacking > /etc/xen/scripts/vif-common.sh. I can detect startup/shutdown > by looking at the first command line argument. > > From there I can examine $XENBUS_PATH to get the ID of the > domain which is being created/destroyed - however there > isn''t a simple mechanism that I''ve seen to get the domain > name. > > So two questions: > > 1. Is there a simple method to get the domain name > from the ID, short of parsing "xm list N"? > > 2. Would this kind of startup/shutdown hook be useful > to others, and if so would a patch be applied? (I''m > happy to submit my code.) > > Steve-- Dave: Just a question. What use is a unicyle with no seat? And no pedals! Mark: To answer a question with a question: What use is a skateboard? Dave: Skateboards have wheels. Mark: My wheel has a wheel! _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Tue, Mar 06, 2007 at 02:38:25PM +0000, Mark Williamson wrote:> Ah cool. Argo looked quite funky to me, so it''ll be interesting to see what > you come up with. Do you have a particular use case in mind that you''re > making this for?Basically for the case where you have N dom0 to monitor and you wish to be able to apply operations upon them centrally. There was a brief mail describing roughly what I intended here: http://lists.cvsrepository.org/xen-tools/Mar07/0235.html For the case where you only want to delegate control of a single domU or two to an indivual, or control all instances upon a single host there is the nice xen-shell... One goal is to allow the backend and the control program to be completely decoupled. So there could be a control panel in PHP, and a GUI in glade/perl/python+gtk for example.> I''ve now replied to your e-mail commenting on technical issues on the > xen-devel list.Cheers, much appreciated. Steve -- Debian GNU/Linux System Administration http://www.debian-administration.org/ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users