Hey, I thought there was supposed to be an ability for domU''s to be put into a hibernated state (E.g. current running tasks and memory) when dom0 is shutdown or rebooted. When I look in my /etc/default/xendomains file, I have the variable''s "XENDOMAINS_SAVE=/var/lib/xen/save" and "XENDOMAINS_RESTORE=true". However, when I reboot, I always have to restart my domains manually and their state was not saved. My current configuration is as follows: Xen 4.2.1, dom0: Debian 7.0, domU:Debian 7.0, dom0 kernel 3.2.0-4 Any idea on what I need to do to get this working properly? Thanks, Josh ________________________________ This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On Tue, 2013-06-18 at 15:16 +0000, Joshua Tuttle wrote:> Hey, > > > > I thought there was supposed to be an ability for domU’s to be put > into a hibernated state (E.g. current running tasks and memory) when > dom0 is shutdown or rebooted. When > > I look in my /etc/default/xendomains file, I have the variable’s > “XENDOMAINS_SAVE=/var/lib/xen/save” and “XENDOMAINS_RESTORE=true”. > However, when I reboot, I always have > > to restart my domains manually and their state was not saved.> My current configuration is as follows: Xen 4.2.1, dom0: Debian 7.0, > domU:Debian 7.0, dom0 kernel 3.2.0-4Are you using the Debian packages or Xen compiled from source? Which toolstack are you using? If you installed from source, did you enable the xendomains script when you did so? (by invoking update-rc.d or something equivalent) Does manually running xendomains ("service xendomains stop" then "service xendomains start") produce any output? Ian. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
-----Original Message----- From: Ian Campbell [mailto:Ian.Campbell@citrix.com] Sent: Tuesday, June 18, 2013 11:33 AM To: Joshua Tuttle Cc: xen-users@lists.xen.org Subject: Re: [Xen-users] DomU suspension/hibernation On Tue, 2013-06-18 at 15:16 +0000, Joshua Tuttle wrote:> Hey, > > > > I thought there was supposed to be an ability for domU’s to be put > into a hibernated state (E.g. current running tasks and memory) when > dom0 is shutdown or rebooted. When > > I look in my /etc/default/xendomains file, I have the variable’s > “XENDOMAINS_SAVE=/var/lib/xen/save” and “XENDOMAINS_RESTORE=true”. > However, when I reboot, I always have > > to restart my domains manually and their state was not saved.> My current configuration is as follows: Xen 4.2.1, dom0: Debian 7.0, > domU:Debian 7.0, dom0 kernel 3.2.0-4Are you using the Debian packages or Xen compiled from source? Which toolstack are you using? If you installed from source, did you enable the xendomains script when you did so? (by invoking update-rc.d or something equivalent) Does manually running xendomains ("service xendomains stop" then "service xendomains start") produce any output? Ian. I am using Xen compiled from source. 4.2.1 and the XL toolstack. I ran update rc.d on xecommons, xend, xendomains, xen-watchdog. Xend can probably be disabled, I'm not sure if having it running would be causing a problem. Manually stopping xendomains produces a line that confirms xendomains is stopped. Starting xendomains produces no output, but I check the service with "xl list" ________________________________ This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On Tue, 2013-06-18 at 15:42 +0000, Joshua Tuttle wrote:> I am using Xen compiled from source. 4.2.1 and the XL toolstack. > I ran update rc.d on xecommons, xend, xendomains, xen-watchdog. > Xend can probably be disabled, I''m not sure if having it running would be causing a problem.It can and does cause problems. Not the problem I think you have, but it can cause other problems, with similar looking symptoms. If you intend to use xl then I strongly recommend turning off xend.> Manually stopping xendomains produces a line that confirms xendomains is stopped. > Starting xendomains produces no output, but I check the service with "xl list"Please can you try cherry-picking this commit from mainline: commit 13b37b6e08679d810544c99e69cfd81b7d34db18 Author: Ian Murray <murrayie@yahoo.co.uk> Date: Thu May 23 11:33:34 2013 +0100 hotplug/Linux: xendomains compatibility with xl The xl save file uses a different header string to the xm one. Teach the xendomains script about it. Signed-off-by: Ian MURRAY <murrayie@yahoo.co.uk> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ ijc -- rewrote commit message ] It ought to fix xendomains with xl. If it works for you I''ll request a backport. Ian.
Joshua, On Tue, Jun 18, 2013 at 10:16 AM, Joshua Tuttle <jtuttle@i-a-i.com> wrote:> Hey, > > > > I thought there was supposed to be an ability for domU’s to be put into a > hibernated state (E.g. current running tasks and memory) when dom0 is > shutdown or rebooted. When > > I look in my /etc/default/xendomains file, I have the variable’s > “XENDOMAINS_SAVE=/var/lib/xen/save” and “XENDOMAINS_RESTORE=true”. However, > when I reboot, I always have > > to restart my domains manually and their state was not saved. > > > > My current configuration is as follows: Xen 4.2.1, dom0: Debian 7.0, > domU:Debian 7.0, dom0 kernel 3.2.0-4 > > > > Any idea on what I need to do to get this working properly? > > > > Thanks, > > Josh >Just to make sure we''ve covered the basics, have you also created the configuration files for the VMs that you want to auto save/restore in /etc/xen/auto ? Regards, David _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
From: David Sutton [mailto:kantras@gmail.com] Sent: Tuesday, June 18, 2013 12:00 PM To: Joshua Tuttle Cc: xen-users@lists.xen.org Subject: Re: [Xen-users] DomU suspension/hibernation Joshua, On Tue, Jun 18, 2013 at 10:16 AM, Joshua Tuttle <jtuttle@i-a-i.com<mailto:jtuttle@i-a-i.com>> wrote: Hey, I thought there was supposed to be an ability for domU''s to be put into a hibernated state (E.g. current running tasks and memory) when dom0 is shutdown or rebooted. When I look in my /etc/default/xendomains file, I have the variable''s "XENDOMAINS_SAVE=/var/lib/xen/save" and "XENDOMAINS_RESTORE=true". However, when I reboot, I always have to restart my domains manually and their state was not saved. My current configuration is as follows: Xen 4.2.1, dom0: Debian 7.0, domU:Debian 7.0, dom0 kernel 3.2.0-4 Any idea on what I need to do to get this working properly? Thanks, Josh Just to make sure we''ve covered the basics, have you also created the configuration files for the VMs that you want to auto save/restore in /etc/xen/auto ? Regards, David Will placing a symlink to my .cfg file in that directory save the state of the domU or just have it automatically start when the computer is rebooted? ________________________________ This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
-----Original Message----- From: Ian Campbell [mailto:Ian.Campbell@citrix.com] Sent: Tuesday, June 18, 2013 11:52 AM To: Joshua Tuttle Cc: xen-users@lists.xen.org Subject: Re: [Xen-users] DomU suspension/hibernation On Tue, 2013-06-18 at 15:42 +0000, Joshua Tuttle wrote:> I am using Xen compiled from source. 4.2.1 and the XL toolstack. > I ran update rc.d on xecommons, xend, xendomains, xen-watchdog. > Xend can probably be disabled, I''m not sure if having it running would be causing a problem.It can and does cause problems. Not the problem I think you have, but it can cause other problems, with similar looking symptoms. If you intend to use xl then I strongly recommend turning off xend.> Manually stopping xendomains produces a line that confirms xendomains is stopped. > Starting xendomains produces no output, but I check the service with "xl list"Please can you try cherry-picking this commit from mainline: commit 13b37b6e08679d810544c99e69cfd81b7d34db18 Author: Ian Murray <murrayie@yahoo.co.uk> Date: Thu May 23 11:33:34 2013 +0100 hotplug/Linux: xendomains compatibility with xl The xl save file uses a different header string to the xm one. Teach the xendomains script about it. Signed-off-by: Ian MURRAY <murrayie@yahoo.co.uk> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ ijc -- rewrote commit message ] It ought to fix xendomains with xl. If it works for you I''ll request a backport. Ian. I turned off xend, and applied the new file, but no luck. ________________________________ This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc.
On 18/06/13 16:42, Joshua Tuttle wrote:> > -----Original Message----- > From: Ian Campbell [mailto:Ian.Campbell@citrix.com] > Sent: Tuesday, June 18, 2013 11:33 AM > To: Joshua Tuttle > Cc: xen-users@lists.xen.org > Subject: Re: [Xen-users] DomU suspension/hibernation > > On Tue, 2013-06-18 at 15:16 +0000, Joshua Tuttle wrote: >> Hey, >> >> >> >> I thought there was supposed to be an ability for domU’s to be put >> into a hibernated state (E.g. current running tasks and memory) when >> dom0 is shutdown or rebooted. When >> >> I look in my /etc/default/xendomains file, I have the variable’s >> “XENDOMAINS_SAVE=/var/lib/xen/save” and “XENDOMAINS_RESTORE=true”. >> However, when I reboot, I always have >> >> to restart my domains manually and their state was not saved. >> My current configuration is as follows: Xen 4.2.1, dom0: Debian 7.0, >> domU:Debian 7.0, dom0 kernel 3.2.0-4 > Are you using the Debian packages or Xen compiled from source? > > Which toolstack are you using? > > If you installed from source, did you enable the xendomains script when you did so? (by invoking update-rc.d or something equivalent) > > Does manually running xendomains ("service xendomains stop" then "service xendomains start") produce any output? > > Ian. > > > I am using Xen compiled from source. 4.2.1 and the XL toolstack. > I ran update rc.d on xecommons, xend, xendomains, xen-watchdog. > Xend can probably be disabled, I'm not sure if having it running would be causing a problem. > Manually stopping xendomains produces a line that confirms xendomains is stopped. > Starting xendomains produces no output, but I check the service with "xl list" > >Have a read of http://osdir.com/ml/general/2013-05/msg46973.html and see if this is the same issue (sorry for not linking directly to Xen, Google seems to link to the wrong message when I follow its links). If it is the same issue, then a patch has been submitted and accepted which I believe is destined for 4.3. Also, there was an issue around the regex stuff which got cleared up by a previous patch that I traced back to yaji (maybe!). I don't know when the other fix came in, so you may need to go to 4.22 to apply the linked patch. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
-----Original Message----- From: xen-users-bounces@lists.xen.org [mailto:xen-users-bounces@lists.xen.org] On Behalf Of Ian Murray Sent: Tuesday, June 18, 2013 1:56 PM To: xen-users@lists.xen.org Subject: Re: [Xen-users] DomU suspension/hibernation On 18/06/13 16:42, Joshua Tuttle wrote:> > -----Original Message----- > From: Ian Campbell [mailto:Ian.Campbell@citrix.com] > Sent: Tuesday, June 18, 2013 11:33 AM > To: Joshua Tuttle > Cc: xen-users@lists.xen.org > Subject: Re: [Xen-users] DomU suspension/hibernation > > On Tue, 2013-06-18 at 15:16 +0000, Joshua Tuttle wrote: >> Hey, >> >> >> >> I thought there was supposed to be an ability for domU’s to be put >> into a hibernated state (E.g. current running tasks and memory) when >> dom0 is shutdown or rebooted. When >> >> I look in my /etc/default/xendomains file, I have the variable’s >> “XENDOMAINS_SAVE=/var/lib/xen/save” and “XENDOMAINS_RESTORE=true”. >> However, when I reboot, I always have >> >> to restart my domains manually and their state was not saved. >> My current configuration is as follows: Xen 4.2.1, dom0: Debian 7.0, >> domU:Debian 7.0, dom0 kernel 3.2.0-4 > Are you using the Debian packages or Xen compiled from source? > > Which toolstack are you using? > > If you installed from source, did you enable the xendomains script > when you did so? (by invoking update-rc.d or something equivalent) > > Does manually running xendomains ("service xendomains stop" then "service xendomains start") produce any output? > > Ian. > > > I am using Xen compiled from source. 4.2.1 and the XL toolstack. > I ran update rc.d on xecommons, xend, xendomains, xen-watchdog. > Xend can probably be disabled, I'm not sure if having it running would be causing a problem. > Manually stopping xendomains produces a line that confirms xendomains is stopped. > Starting xendomains produces no output, but I check the service with "xl list" > >Have a read of http://osdir.com/ml/general/2013-05/msg46973.html and see if this is the same issue (sorry for not linking directly to Xen, Google seems to link to the wrong message when I follow its links). If it is the same issue, then a patch has been submitted and accepted which I believe is destined for 4.3. Also, there was an issue around the regex stuff which got cleared up by a previous patch that I traced back to yaji (maybe!). I don't know when the other fix came in, so you may need to go to 4.22 to apply the linked patch. Thanks for replying. I applied a patch " hotplug/Linux: xendomains compatibility with xl" , but still have had no luck. The only thing it fixed, is if I place a symlink to my config file in /etc/xen/auto, it will automatically start the domU instance. However, its still not putting a previous instance into a hibernated state. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users ________________________________ This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Joshua, On Tue, Jun 18, 2013 at 1:44 PM, Joshua Tuttle <jtuttle@i-a-i.com> wrote:> > > Thanks for replying. > > I applied a patch " hotplug/Linux: xendomains compatibility with xl" , but > still have had no luck. The only thing it fixed, is if I place a symlink to > my config file in /etc/xen/auto, it will automatically start the domU > instance. However, its still not putting a previous instance into a > hibernated state. > _______________________________________________ > >Try this: edit /etc/xen/xl.conf and add in the following line (remove if its already in there and using ''json'': -- output_format="sxp" -- One thing I noted when looking in there is that a lot of the logic around determining dom information is based on the sxp format. I''m looking into a way to change that over to use json (will need to be using perl instead of sed, from what I can tell, since sed doesn''t seem to like the non-greedy regex operation) Regards, David _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On 18/06/13 19:44, Joshua Tuttle wrote:> > -----Original Message----- > From: xen-users-bounces@lists.xen.org [mailto:xen-users-bounces@lists.xen.org] On Behalf Of Ian Murray > Sent: Tuesday, June 18, 2013 1:56 PM > To: xen-users@lists.xen.org > Subject: Re: [Xen-users] DomU suspension/hibernation > > On 18/06/13 16:42, Joshua Tuttle wrote: >> -----Original Message----- >> From: Ian Campbell [mailto:Ian.Campbell@citrix.com] >> Sent: Tuesday, June 18, 2013 11:33 AM >> To: Joshua Tuttle >> Cc: xen-users@lists.xen.org >> Subject: Re: [Xen-users] DomU suspension/hibernation >> >> On Tue, 2013-06-18 at 15:16 +0000, Joshua Tuttle wrote: >>> Hey, >>> >>> >>> >>> I thought there was supposed to be an ability for domU’s to be put >>> into a hibernated state (E.g. current running tasks and memory) when >>> dom0 is shutdown or rebooted. When >>> >>> I look in my /etc/default/xendomains file, I have the variable’s >>> “XENDOMAINS_SAVE=/var/lib/xen/save” and “XENDOMAINS_RESTORE=true”. >>> However, when I reboot, I always have >>> >>> to restart my domains manually and their state was not saved. >>> My current configuration is as follows: Xen 4.2.1, dom0: Debian 7.0, >>> domU:Debian 7.0, dom0 kernel 3.2.0-4 >> Are you using the Debian packages or Xen compiled from source? >> >> Which toolstack are you using? >> >> If you installed from source, did you enable the xendomains script >> when you did so? (by invoking update-rc.d or something equivalent) >> >> Does manually running xendomains ("service xendomains stop" then "service xendomains start") produce any output? >> >> Ian. >> >> >> I am using Xen compiled from source. 4.2.1 and the XL toolstack. >> I ran update rc.d on xecommons, xend, xendomains, xen-watchdog. >> Xend can probably be disabled, I'm not sure if having it running would be causing a problem. >> Manually stopping xendomains produces a line that confirms xendomains is stopped. >> Starting xendomains produces no output, but I check the service with "xl list" >> >> > Have a read of http://osdir.com/ml/general/2013-05/msg46973.html and see if this is the same issue (sorry for not linking directly to Xen, Google seems to link to the wrong message when I follow its links). > > If it is the same issue, then a patch has been submitted and accepted which I believe is destined for 4.3. Also, there was an issue around the regex stuff which got cleared up by a previous patch that I traced back to yaji (maybe!). I don't know when the other fix came in, so you may need to go to 4.22 to apply the linked patch. > > > > Thanks for replying. > > I applied a patch " hotplug/Linux: xendomains compatibility with xl" , but still have had no luck. The only thing it fixed, is if I place a symlink to my config file in /etc/xen/auto, it will automatically start the domU instance. However, its still not putting a previous instance into a hibernated state. >I think that is the same patch I linked... which is odd because it isn't supposed to fix an auto issue. I don't recall in issue for that myself. Did you patch against 4.2.2 or 4.2.1? If it is the yaji/regex issue then I think that would have caused issue against stopping rather than restarting, as it has issue with xl list -l, AFAIR. I presume the save file gets created, but just incase, please try:- (Assuming you have a domU running) root@xen6:/var/lib/xen/save# service xendomains stop Shutting down Xen domains: vpn2(save).... * [done] root@xen6:/var/lib/xen/save# ls /var/lib/xen/save vpn2 root@xen6:/var/lib/xen/save# service xendomains start Restoring Xen domains: vpn2 * [done] root@xen6://var/lib/xen/save# ls /var/lib/xen/save root@xen6://var/lib/xen/save# for me, it is gone on the second ls. If it is still there, what happens if you manually reload it with:- xl restore /var/lib/xen/save/vpn2 (in my case) _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
-----Original Message----- From: Ian Murray [mailto:murrayie@yahoo.co.uk] Sent: Tuesday, June 18, 2013 3:19 PM To: Joshua Tuttle Cc: xen-users@lists.xen.org Subject: Re: [Xen-users] DomU suspension/hibernation On 18/06/13 19:44, Joshua Tuttle wrote:> > -----Original Message----- > From: xen-users-bounces@lists.xen.org > [mailto:xen-users-bounces@lists.xen.org] On Behalf Of Ian Murray > Sent: Tuesday, June 18, 2013 1:56 PM > To: xen-users@lists.xen.org > Subject: Re: [Xen-users] DomU suspension/hibernation > > On 18/06/13 16:42, Joshua Tuttle wrote: >> -----Original Message----- >> From: Ian Campbell [mailto:Ian.Campbell@citrix.com] >> Sent: Tuesday, June 18, 2013 11:33 AM >> To: Joshua Tuttle >> Cc: xen-users@lists.xen.org >> Subject: Re: [Xen-users] DomU suspension/hibernation >> >> On Tue, 2013-06-18 at 15:16 +0000, Joshua Tuttle wrote: >>> Hey, >>> >>> >>> >>> I thought there was supposed to be an ability for domU’s to be put >>> into a hibernated state (E.g. current running tasks and memory) when >>> dom0 is shutdown or rebooted. When >>> >>> I look in my /etc/default/xendomains file, I have the variable’s >>> “XENDOMAINS_SAVE=/var/lib/xen/save” and “XENDOMAINS_RESTORE=true”. >>> However, when I reboot, I always have >>> >>> to restart my domains manually and their state was not saved. >>> My current configuration is as follows: Xen 4.2.1, dom0: Debian 7.0, >>> domU:Debian 7.0, dom0 kernel 3.2.0-4 >> Are you using the Debian packages or Xen compiled from source? >> >> Which toolstack are you using? >> >> If you installed from source, did you enable the xendomains script >> when you did so? (by invoking update-rc.d or something equivalent) >> >> Does manually running xendomains ("service xendomains stop" then "service xendomains start") produce any output? >> >> Ian. >> >> >> I am using Xen compiled from source. 4.2.1 and the XL toolstack. >> I ran update rc.d on xecommons, xend, xendomains, xen-watchdog. >> Xend can probably be disabled, I'm not sure if having it running would be causing a problem. >> Manually stopping xendomains produces a line that confirms xendomains is stopped. >> Starting xendomains produces no output, but I check the service with "xl list" >> >> > Have a read of http://osdir.com/ml/general/2013-05/msg46973.html and see if this is the same issue (sorry for not linking directly to Xen, Google seems to link to the wrong message when I follow its links). > > If it is the same issue, then a patch has been submitted and accepted which I believe is destined for 4.3. Also, there was an issue around the regex stuff which got cleared up by a previous patch that I traced back to yaji (maybe!). I don't know when the other fix came in, so you may need to go to 4.22 to apply the linked patch. > > > > Thanks for replying. > > I applied a patch " hotplug/Linux: xendomains compatibility with xl" , but still have had no luck. The only thing it fixed, is if I place a symlink to my config file in /etc/xen/auto, it will automatically start the domU instance. However, its still not putting a previous instance into a hibernated state. >I think that is the same patch I linked... which is odd because it isn't supposed to fix an auto issue. I don't recall in issue for that myself. Did you patch against 4.2.2 or 4.2.1? If it is the yaji/regex issue then I think that would have caused issue against stopping rather than restarting, as it has issue with xl list -l, AFAIR. I presume the save file gets created, but just incase, please try:- (Assuming you have a domU running) root@xen6:/var/lib/xen/save# service xendomains stop Shutting down Xen domains: vpn2(save).... * [done] root@xen6:/var/lib/xen/save# ls /var/lib/xen/save vpn2 root@xen6:/var/lib/xen/save# service xendomains start Restoring Xen domains: vpn2 * [done] root@xen6://var/lib/xen/save# ls /var/lib/xen/save root@xen6://var/lib/xen/save# for me, it is gone on the second ls. If it is still there, what happens if you manually reload it with:- xl restore /var/lib/xen/save/vpn2 (in my case) I applied it against 4.2.1. When I run "service xendomains stop" I receive the following output: An error occurred while saving domain: Option `1' not supported. 'xl save' requires at least 2 arguments. ! (shut) An error occurred while shutting down domain: ! SHUTDOWN_ALL An error occurred while shutting down all domains: ! [ ok ] [done]. ________________________________ This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On 18/06/13 19:56, David Sutton wrote:> Joshua, > > On Tue, Jun 18, 2013 at 1:44 PM, Joshua Tuttle <jtuttle@i-a-i.com > <mailto:jtuttle@i-a-i.com>> wrote: > > > Thanks for replying. > > I applied a patch " hotplug/Linux: xendomains compatibility with > xl" , but still have had no luck. The only thing it fixed, is if I > place a symlink to my config file in /etc/xen/auto, it will > automatically start the domU instance. However, its still not > putting a previous instance into a hibernated state. > _______________________________________________ > > > Try this: edit /etc/xen/xl.conf and add in the following line (remove > if its already in there and using ''json'': > -- > output_format="sxp" > -- > > One thing I noted when looking in there is that a lot of the logic > around determining dom information is based on the sxp format. I''m > looking into a way to change that over to use json (will need to be > using perl instead of sed, from what I can tell, since sed doesn''t > seem to like the non-greedy regex operation) > > Regards, > > DavidWould this affect the restore element of xendomains. AFAIR, it just iterates through the save folder and tries to restore whatever is there provided the header matches (which the patch is supposed to fix). Actually, Joshua, can you paste up lines 28 to 38 and line 260 of xendomains If you have applied the patch I think you have, should be like:- CMD=xm HEADCOMP="LinuxGuestRecord" $CMD list &> /dev/null if test $? -ne 0 then CMD=xl HEADCOMP="Xen saved domain" fi - and - if [ "$HEADER" = "$HEADCOMP" ]; then _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On 18/06/13 20:36, Joshua Tuttle wrote:> > -----Original Message----- > From: Ian Murray [mailto:murrayie@yahoo.co.uk] > Sent: Tuesday, June 18, 2013 3:19 PM > To: Joshua Tuttle > Cc: xen-users@lists.xen.org > Subject: Re: [Xen-users] DomU suspension/hibernation > > On 18/06/13 19:44, Joshua Tuttle wrote: >> -----Original Message----- >> From: xen-users-bounces@lists.xen.org >> [mailto:xen-users-bounces@lists.xen.org] On Behalf Of Ian Murray >> Sent: Tuesday, June 18, 2013 1:56 PM >> To: xen-users@lists.xen.org >> Subject: Re: [Xen-users] DomU suspension/hibernation >> >> On 18/06/13 16:42, Joshua Tuttle wrote: >>> -----Original Message----- >>> From: Ian Campbell [mailto:Ian.Campbell@citrix.com] >>> Sent: Tuesday, June 18, 2013 11:33 AM >>> To: Joshua Tuttle >>> Cc: xen-users@lists.xen.org >>> Subject: Re: [Xen-users] DomU suspension/hibernation >>> >>> On Tue, 2013-06-18 at 15:16 +0000, Joshua Tuttle wrote: >>>> Hey, >>>> >>>> >>>> >>>> I thought there was supposed to be an ability for domU’s to be put >>>> into a hibernated state (E.g. current running tasks and memory) when >>>> dom0 is shutdown or rebooted. When >>>> >>>> I look in my /etc/default/xendomains file, I have the variable’s >>>> “XENDOMAINS_SAVE=/var/lib/xen/save” and “XENDOMAINS_RESTORE=true”. >>>> However, when I reboot, I always have >>>> >>>> to restart my domains manually and their state was not saved. >>>> My current configuration is as follows: Xen 4.2.1, dom0: Debian 7.0, >>>> domU:Debian 7.0, dom0 kernel 3.2.0-4 >>> Are you using the Debian packages or Xen compiled from source? >>> >>> Which toolstack are you using? >>> >>> If you installed from source, did you enable the xendomains script >>> when you did so? (by invoking update-rc.d or something equivalent) >>> >>> Does manually running xendomains ("service xendomains stop" then "service xendomains start") produce any output? >>> >>> Ian. >>> >>> >>> I am using Xen compiled from source. 4.2.1 and the XL toolstack. >>> I ran update rc.d on xecommons, xend, xendomains, xen-watchdog. >>> Xend can probably be disabled, I'm not sure if having it running would be causing a problem. >>> Manually stopping xendomains produces a line that confirms xendomains is stopped. >>> Starting xendomains produces no output, but I check the service with "xl list" >>> >>> >> Have a read of http://osdir.com/ml/general/2013-05/msg46973.html and see if this is the same issue (sorry for not linking directly to Xen, Google seems to link to the wrong message when I follow its links). >> >> If it is the same issue, then a patch has been submitted and accepted which I believe is destined for 4.3. Also, there was an issue around the regex stuff which got cleared up by a previous patch that I traced back to yaji (maybe!). I don't know when the other fix came in, so you may need to go to 4.22 to apply the linked patch. >> >> >> >> Thanks for replying. >> >> I applied a patch " hotplug/Linux: xendomains compatibility with xl" , but still have had no luck. The only thing it fixed, is if I place a symlink to my config file in /etc/xen/auto, it will automatically start the domU instance. However, its still not putting a previous instance into a hibernated state. >> > I think that is the same patch I linked... which is odd because it isn't supposed to fix an auto issue. I don't recall in issue for that myself. > Did you patch against 4.2.2 or 4.2.1? If it is the yaji/regex issue then I think that would have caused issue against stopping rather than restarting, as it has issue with xl list -l, AFAIR. > > I presume the save file gets created, but just incase, please try:- > > > (Assuming you have a domU running) > root@xen6:/var/lib/xen/save# service xendomains stop Shutting down Xen domains: vpn2(save).... > * [done] > root@xen6:/var/lib/xen/save# ls /var/lib/xen/save > vpn2 > root@xen6:/var/lib/xen/save# service xendomains start Restoring Xen domains: vpn2 > * [done] > root@xen6://var/lib/xen/save# ls /var/lib/xen/save root@xen6://var/lib/xen/save# > > for me, it is gone on the second ls. > > If it is still there, what happens if you manually reload it with:- > > xl restore /var/lib/xen/save/vpn2 (in my case) > > > > > I applied it against 4.2.1. When I run "service xendomains stop" I receive the following output: > > An error occurred while saving domain: > Option `1' not supported. > 'xl save' requires at least 2 arguments. > > ! > (shut) > An error occurred while shutting down domain: > > ! > SHUTDOWN_ALL > An error occurred while shutting down all domains: > > ! > [ ok ] [done]. > > > > > > ________________________________ > This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc.Is this different behaviour now because you said that part was working earlier? What is the output of xl list -l ? I think this is the command xendomains uses to generate the list to shutdown. Unfortunately, you are not in the territory I thought you were. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
________________________________________ From: Ian Murray Sent: Tuesday, June 18, 2013 3:46 PM To: Joshua Tuttle Cc: xen-users@lists.xen.org Subject: Re: [Xen-users] DomU suspension/hibernation On 18/06/13 20:36, Joshua Tuttle wrote:> > -----Original Message----- > From: Ian Murray [mailto:murrayie@yahoo.co.uk] > Sent: Tuesday, June 18, 2013 3:19 PM > To: Joshua Tuttle > Cc: xen-users@lists.xen.org > Subject: Re: [Xen-users] DomU suspension/hibernation > > On 18/06/13 19:44, Joshua Tuttle wrote: >> -----Original Message----- >> From: xen-users-bounces@lists.xen.org >> [mailto:xen-users-bounces@lists.xen.org] On Behalf Of Ian Murray >> Sent: Tuesday, June 18, 2013 1:56 PM >> To: xen-users@lists.xen.org >> Subject: Re: [Xen-users] DomU suspension/hibernation >> >> On 18/06/13 16:42, Joshua Tuttle wrote: >>> -----Original Message----- >>> From: Ian Campbell [mailto:Ian.Campbell@citrix.com] >>> Sent: Tuesday, June 18, 2013 11:33 AM >>> To: Joshua Tuttle >>> Cc: xen-users@lists.xen.org >>> Subject: Re: [Xen-users] DomU suspension/hibernation >>> >>> On Tue, 2013-06-18 at 15:16 +0000, Joshua Tuttle wrote: >>>> Hey, >>>> >>>> >>>> >>>> I thought there was supposed to be an ability for domU’s to be put >>>> into a hibernated state (E.g. current running tasks and memory) when >>>> dom0 is shutdown or rebooted. When >>>> >>>> I look in my /etc/default/xendomains file, I have the variable’s >>>> “XENDOMAINS_SAVE=/var/lib/xen/save” and “XENDOMAINS_RESTORE=true”. >>>> However, when I reboot, I always have >>>> >>>> to restart my domains manually and their state was not saved. >>>> My current configuration is as follows: Xen 4.2.1, dom0: Debian 7.0, >>>> domU:Debian 7.0, dom0 kernel 3.2.0-4 >>> Are you using the Debian packages or Xen compiled from source? >>> >>> Which toolstack are you using? >>> >>> If you installed from source, did you enable the xendomains script >>> when you did so? (by invoking update-rc.d or something equivalent) >>> >>> Does manually running xendomains ("service xendomains stop" then "service xendomains start") produce any output? >>> >>> Ian. >>> >>> >>> I am using Xen compiled from source. 4.2.1 and the XL toolstack. >>> I ran update rc.d on xecommons, xend, xendomains, xen-watchdog. >>> Xend can probably be disabled, I''m not sure if having it running would be causing a problem. >>> Manually stopping xendomains produces a line that confirms xendomains is stopped. >>> Starting xendomains produces no output, but I check the service with "xl list" >>> >>> >> Have a read of http://osdir.com/ml/general/2013-05/msg46973.html and see if this is the same issue (sorry for not linking directly to Xen, Google seems to link to the wrong message when I follow its links). >> >> If it is the same issue, then a patch has been submitted and accepted which I believe is destined for 4.3. Also, there was an issue around the regex stuff which got cleared up by a previous patch that I traced back to yaji (maybe!). I don''t know when the other fix came in, so you may need to go to 4.22 to apply the linked patch. >> >> >> >> Thanks for replying. >> >> I applied a patch " hotplug/Linux: xendomains compatibility with xl" , but still have had no luck. The only thing it fixed, is if I place a symlink to my config file in /etc/xen/auto, it will automatically start the domU instance. However, its still not putting a previous instance into a hibernated state. >> > I think that is the same patch I linked... which is odd because it isn''t supposed to fix an auto issue. I don''t recall in issue for that myself. > Did you patch against 4.2.2 or 4.2.1? If it is the yaji/regex issue then I think that would have caused issue against stopping rather than restarting, as it has issue with xl list -l, AFAIR. > > I presume the save file gets created, but just incase, please try:- > > > (Assuming you have a domU running) > root@xen6:/var/lib/xen/save# service xendomains stop Shutting down Xen domains: vpn2(save).... > * [done] > root@xen6:/var/lib/xen/save# ls /var/lib/xen/save > vpn2 > root@xen6:/var/lib/xen/save# service xendomains start Restoring Xen domains: vpn2 > * [done] > root@xen6://var/lib/xen/save# ls /var/lib/xen/save root@xen6://var/lib/xen/save# > > for me, it is gone on the second ls. > > If it is still there, what happens if you manually reload it with:- > > xl restore /var/lib/xen/save/vpn2 (in my case) > > > > > I applied it against 4.2.1. When I run "service xendomains stop" I receive the following output: > > An error occurred while saving domain: > Option `1'' not supported. > ''xl save'' requires at least 2 arguments. > > ! > (shut) > An error occurred while shutting down domain: > > ! > SHUTDOWN_ALL > An error occurred while shutting down all domains: > > ! > [ ok ] [done]. > > > > > > ________________________________ > This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc.Is this different behaviour now because you said that part was working earlier? What is the output of xl list -l ? I think this is the command xendomains uses to generate the list to shutdown. Unfortunately, you are not in the territory I thought you were. This is my output: (domain (domid -1) (create_info) (hvm 1) (hap <default>) (oos <default>) (ssidref 0) (name joshtest) (uuid <unknown>) (cpupool Pool-0) (xsdata (null)) (platformdata (null)) (build_info) (max_vcpus 1) (tsc_mode default) (max_memkb 1048576) (target_memkb 1048576) (nomigrate <default>) (image (hvm (firmware (null)) (video_memkb -1) (shadow_memkb 9216) (pae <default>) (apic <default>) (acpi True) (nx <default>) (viridian <default>) (hpet <default>) (vpt_align <default>) (timer_mode (null)) (nestedhvm <default>) (stdvga False) (vnc True) (vnclisten 0.0.0.0) (vncdisplay 0) (vncunused <default>) (keymap (null)) (sdl False) (opengl <default>) (nographic <default>) (spice <default>) (spiceport 0) (spicetls_port 0) (spicehost (null)) (spicedisable_ticketing <default>) (spiceagent_mouse <default>) (device_model default) (gfx_passthru <default>) (serial pty) (boot (null)) (usb <default>) (usbdevice mouse) ) ) (device (tap (backend_domid 0) (frontend_domid -1) (physpath /home/josh/domu1.img) (phystype 0) (virtpath hda) (unpluggable 0) (readwrite 1) (is_cdrom 0) ) ) ) ________________________________ This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc.
-----Original Message----- From: Ian Murray [mailto:murrayie@yahoo.co.uk] Sent: Tuesday, June 18, 2013 3:46 PM To: Joshua Tuttle Cc: xen-users@lists.xen.org Subject: Re: [Xen-users] DomU suspension/hibernation On 18/06/13 20:36, Joshua Tuttle wrote:> > -----Original Message----- > From: Ian Murray [mailto:murrayie@yahoo.co.uk] > Sent: Tuesday, June 18, 2013 3:19 PM > To: Joshua Tuttle > Cc: xen-users@lists.xen.org > Subject: Re: [Xen-users] DomU suspension/hibernation > > On 18/06/13 19:44, Joshua Tuttle wrote: >> -----Original Message----- >> From: xen-users-bounces@lists.xen.org >> [mailto:xen-users-bounces@lists.xen.org] On Behalf Of Ian Murray >> Sent: Tuesday, June 18, 2013 1:56 PM >> To: xen-users@lists.xen.org >> Subject: Re: [Xen-users] DomU suspension/hibernation >> >> On 18/06/13 16:42, Joshua Tuttle wrote: >>> -----Original Message----- >>> From: Ian Campbell [mailto:Ian.Campbell@citrix.com] >>> Sent: Tuesday, June 18, 2013 11:33 AM >>> To: Joshua Tuttle >>> Cc: xen-users@lists.xen.org >>> Subject: Re: [Xen-users] DomU suspension/hibernation >>> >>> On Tue, 2013-06-18 at 15:16 +0000, Joshua Tuttle wrote: >>>> Hey, >>>> >>>> >>>> >>>> I thought there was supposed to be an ability for domU’s to be put >>>> into a hibernated state (E.g. current running tasks and memory) >>>> when >>>> dom0 is shutdown or rebooted. When >>>> >>>> I look in my /etc/default/xendomains file, I have the variable’s >>>> “XENDOMAINS_SAVE=/var/lib/xen/save” and “XENDOMAINS_RESTORE=true”. >>>> However, when I reboot, I always have >>>> >>>> to restart my domains manually and their state was not saved. >>>> My current configuration is as follows: Xen 4.2.1, dom0: Debian >>>> 7.0, domU:Debian 7.0, dom0 kernel 3.2.0-4 >>> Are you using the Debian packages or Xen compiled from source? >>> >>> Which toolstack are you using? >>> >>> If you installed from source, did you enable the xendomains script >>> when you did so? (by invoking update-rc.d or something equivalent) >>> >>> Does manually running xendomains ("service xendomains stop" then "service xendomains start") produce any output? >>> >>> Ian. >>> >>> >>> I am using Xen compiled from source. 4.2.1 and the XL toolstack. >>> I ran update rc.d on xecommons, xend, xendomains, xen-watchdog. >>> Xend can probably be disabled, I'm not sure if having it running would be causing a problem. >>> Manually stopping xendomains produces a line that confirms xendomains is stopped. >>> Starting xendomains produces no output, but I check the service with "xl list" >>> >>> >> Have a read of http://osdir.com/ml/general/2013-05/msg46973.html and see if this is the same issue (sorry for not linking directly to Xen, Google seems to link to the wrong message when I follow its links). >> >> If it is the same issue, then a patch has been submitted and accepted which I believe is destined for 4.3. Also, there was an issue around the regex stuff which got cleared up by a previous patch that I traced back to yaji (maybe!). I don't know when the other fix came in, so you may need to go to 4.22 to apply the linked patch. >> >> >> >> Thanks for replying. >> >> I applied a patch " hotplug/Linux: xendomains compatibility with xl" , but still have had no luck. The only thing it fixed, is if I place a symlink to my config file in /etc/xen/auto, it will automatically start the domU instance. However, its still not putting a previous instance into a hibernated state. >> > I think that is the same patch I linked... which is odd because it isn't supposed to fix an auto issue. I don't recall in issue for that myself. > Did you patch against 4.2.2 or 4.2.1? If it is the yaji/regex issue then I think that would have caused issue against stopping rather than restarting, as it has issue with xl list -l, AFAIR. > > I presume the save file gets created, but just incase, please try:- > > > (Assuming you have a domU running) > root@xen6:/var/lib/xen/save# service xendomains stop Shutting down Xen domains: vpn2(save).... > * [done] > root@xen6:/var/lib/xen/save# ls /var/lib/xen/save > vpn2 > root@xen6:/var/lib/xen/save# service xendomains start Restoring Xen domains: vpn2 > * [done] > root@xen6://var/lib/xen/save# ls /var/lib/xen/save > root@xen6://var/lib/xen/save# > > for me, it is gone on the second ls. > > If it is still there, what happens if you manually reload it with:- > > xl restore /var/lib/xen/save/vpn2 (in my case) > > > > > I applied it against 4.2.1. When I run "service xendomains stop" I receive the following output: > > An error occurred while saving domain: > Option `1' not supported. > 'xl save' requires at least 2 arguments. > > ! > (shut) > An error occurred while shutting down domain: > > ! > SHUTDOWN_ALL > An error occurred while shutting down all domains: > > ! > [ ok ] [done]. > > > > > > ________________________________ > This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc.Is this different behaviour now because you said that part was working earlier? What is the output of xl list -l ? I think this is the command xendomains uses to generate the list to shutdown. Unfortunately, you are not in the territory I thought you were. Yeah this is new behavior. The only things I have changed so far are applying the patch and editing the xl.conf file to reflect "OUTPUT_FORMAT=sxp". Now I'm second guessing if I have applied the patch correctly. Here are the lines from the new file Lines 32 -39 CMD=${SBINDIR}/xm HEADCOMP="LinuxGuestRecord" $CMD list &> /dev/null If test $? -ne 0 Then CMD=${SBINDIR}/xl HEADCOMP="Xen saved domain" Fi Line 260 If [ -f $dom ] ; then ________________________________ This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On 18/06/13 20:55, Joshua Tuttle wrote:> ________________________________________ > From: Ian Murray > Sent: Tuesday, June 18, 2013 3:46 PM > To: Joshua Tuttle > Cc: xen-users@lists.xen.org > Subject: Re: [Xen-users] DomU suspension/hibernation > > On 18/06/13 20:36, Joshua Tuttle wrote: >> -----Original Message----- >> From: Ian Murray [mailto:murrayie@yahoo.co.uk] >> Sent: Tuesday, June 18, 2013 3:19 PM >> To: Joshua Tuttle >> Cc: xen-users@lists.xen.org >> Subject: Re: [Xen-users] DomU suspension/hibernation >> >> On 18/06/13 19:44, Joshua Tuttle wrote: >>> -----Original Message----- >>> From: xen-users-bounces@lists.xen.org >>> [mailto:xen-users-bounces@lists.xen.org] On Behalf Of Ian Murray >>> Sent: Tuesday, June 18, 2013 1:56 PM >>> To: xen-users@lists.xen.org >>> Subject: Re: [Xen-users] DomU suspension/hibernation >>> >>> On 18/06/13 16:42, Joshua Tuttle wrote: >>>> -----Original Message----- >>>> From: Ian Campbell [mailto:Ian.Campbell@citrix.com] >>>> Sent: Tuesday, June 18, 2013 11:33 AM >>>> To: Joshua Tuttle >>>> Cc: xen-users@lists.xen.org >>>> Subject: Re: [Xen-users] DomU suspension/hibernation >>>> >>>> On Tue, 2013-06-18 at 15:16 +0000, Joshua Tuttle wrote: >>>>> Hey, >>>>> >>>>> >>>>> >>>>> I thought there was supposed to be an ability for domU’s to be put >>>>> into a hibernated state (E.g. current running tasks and memory) when >>>>> dom0 is shutdown or rebooted. When >>>>> >>>>> I look in my /etc/default/xendomains file, I have the variable’s >>>>> “XENDOMAINS_SAVE=/var/lib/xen/save” and “XENDOMAINS_RESTORE=true”. >>>>> However, when I reboot, I always have >>>>> >>>>> to restart my domains manually and their state was not saved. >>>>> My current configuration is as follows: Xen 4.2.1, dom0: Debian 7.0, >>>>> domU:Debian 7.0, dom0 kernel 3.2.0-4 >>>> Are you using the Debian packages or Xen compiled from source? >>>> >>>> Which toolstack are you using? >>>> >>>> If you installed from source, did you enable the xendomains script >>>> when you did so? (by invoking update-rc.d or something equivalent) >>>> >>>> Does manually running xendomains ("service xendomains stop" then "service xendomains start") produce any output? >>>> >>>> Ian. >>>> >>>> >>>> I am using Xen compiled from source. 4.2.1 and the XL toolstack. >>>> I ran update rc.d on xecommons, xend, xendomains, xen-watchdog. >>>> Xend can probably be disabled, I''m not sure if having it running would be causing a problem. >>>> Manually stopping xendomains produces a line that confirms xendomains is stopped. >>>> Starting xendomains produces no output, but I check the service with "xl list" >>>> >>>> >>> Have a read of http://osdir.com/ml/general/2013-05/msg46973.html and see if this is the same issue (sorry for not linking directly to Xen, Google seems to link to the wrong message when I follow its links). >>> >>> If it is the same issue, then a patch has been submitted and accepted which I believe is destined for 4.3. Also, there was an issue around the regex stuff which got cleared up by a previous patch that I traced back to yaji (maybe!). I don''t know when the other fix came in, so you may need to go to 4.22 to apply the linked patch. >>> >>> >>> >>> Thanks for replying. >>> >>> I applied a patch " hotplug/Linux: xendomains compatibility with xl" , but still have had no luck. The only thing it fixed, is if I place a symlink to my config file in /etc/xen/auto, it will automatically start the domU instance. However, its still not putting a previous instance into a hibernated state. >>> >> I think that is the same patch I linked... which is odd because it isn''t supposed to fix an auto issue. I don''t recall in issue for that myself. >> Did you patch against 4.2.2 or 4.2.1? If it is the yaji/regex issue then I think that would have caused issue against stopping rather than restarting, as it has issue with xl list -l, AFAIR. >> >> I presume the save file gets created, but just incase, please try:- >> >> >> (Assuming you have a domU running) >> root@xen6:/var/lib/xen/save# service xendomains stop Shutting down Xen domains: vpn2(save).... >> * [done] >> root@xen6:/var/lib/xen/save# ls /var/lib/xen/save >> vpn2 >> root@xen6:/var/lib/xen/save# service xendomains start Restoring Xen domains: vpn2 >> * [done] >> root@xen6://var/lib/xen/save# ls /var/lib/xen/save root@xen6://var/lib/xen/save# >> >> for me, it is gone on the second ls. >> >> If it is still there, what happens if you manually reload it with:- >> >> xl restore /var/lib/xen/save/vpn2 (in my case) >> >> >> >> >> I applied it against 4.2.1. When I run "service xendomains stop" I receive the following output: >> >> An error occurred while saving domain: >> Option `1'' not supported. >> ''xl save'' requires at least 2 arguments. >> >> ! >> (shut) >> An error occurred while shutting down domain: >> >> ! >> SHUTDOWN_ALL >> An error occurred while shutting down all domains: >> >> ! >> [ ok ] [done]. >> >> >> >> >> >> ________________________________ >> This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc. > Is this different behaviour now because you said that part was working > earlier? > > What is the output of xl list -l ? I think this is the command > xendomains uses to generate the list to shutdown. > > Unfortunately, you are not in the territory I thought you were. > > > > > > This is my output: > > (domain > (domid -1) > (create_info) > (hvm 1) > (hap <default>) > (oos <default>) > (ssidref 0) > (name joshtest) > (uuid <unknown>) > (cpupool Pool-0) > (xsdata (null)) > (platformdata (null)) > (build_info) > (max_vcpus 1) > (tsc_mode default) > (max_memkb 1048576) > (target_memkb 1048576) > (nomigrate <default>) > (image > (hvm > (firmware (null)) > (video_memkb -1) > (shadow_memkb 9216) > (pae <default>) > (apic <default>) > (acpi True) > (nx <default>) > (viridian <default>) > (hpet <default>) > (vpt_align <default>) > (timer_mode (null)) > (nestedhvm <default>) > (stdvga False) > (vnc True) > (vnclisten 0.0.0.0) > (vncdisplay 0) > (vncunused <default>) > (keymap (null)) > (sdl False) > (opengl <default>) > (nographic <default>) > (spice <default>) > (spiceport 0) > (spicetls_port 0) > (spicehost (null)) > (spicedisable_ticketing <default>) > (spiceagent_mouse <default>) > (device_model default) > (gfx_passthru <default>) > (serial pty) > (boot (null)) > (usb <default>) > (usbdevice mouse) > ) > ) > (device > (tap > (backend_domid 0) > (frontend_domid -1) > (physpath /home/josh/domu1.img) > (phystype 0) > (virtpath hda) > (unpluggable 0) > (readwrite 1) > (is_cdrom 0) > ) > ) > ) >Right, I can recreate your problem. It''s what was mentioned earlier by another poster about the output of xl list -l. Try removing the line output_format="sxp" from you /etc/xen/xl.conf Mine looks totally different (It''s in JSON)
> > > Yeah this is new behavior. The only things I have changed so far are applying the patch and editing the xl.conf file to reflect "OUTPUT_FORMAT=sxp". > > Now I''m second guessing if I have applied the patch correctly. > > Here are the lines from the new file > > > Lines 32 -39 > > CMD=${SBINDIR}/xm > HEADCOMP="LinuxGuestRecord" > $CMD list &> /dev/null > If test $? -ne 0 > Then > CMD=${SBINDIR}/xl > HEADCOMP="Xen saved domain" > Fi > > > Line 260 > > If [ -f $dom ] ; then > > >Okay, line 262, then... not 260. Right, when I remove the sxp, it works find for one guest guests but I am also getting an issue with more than one guest.... Name ID Mem VCPUs State Time(s) Domain-0 0 1021 2 r----- 122.2 vpn2 9 192 1 -b---- 0.0 win 10 2037 2 -b---- 21.5 root@xen6:/etc/init.d# service xendomains stop Shutting down Xen domains: vpn2(save)..... vpn2(save).......................... win(save) An error occurred while saving domain: 10 is an invalid domain identifier (rc=-6) ! (shut) An error occurred while shutting down domain: 10 is an invalid domain identifier (rc=-6) ! * [done] root@xen6:/etc/init.d# ls /var/lib/xen/save vpn2 The two vpn2(save) are not good. root@xen6:/etc/init.d# ls -al /var/lib/xen/save total 2090892 drwxr-xr-x 2 root root 4096 Jun 18 21:25 . drwxr-xr-x 4 root root 4096 Jun 18 21:25 .. -rw-r--r-- 1 root root 2141058115 Jun 18 21:25 vpn2 Looks like the windows domain has been save with the wrong name. In fact, I can restore it manually and it is the HVM. Let me re-check my scripts. I may have used an old one by mistake.
-----Original Message----- From: Ian Murray [mailto:murrayie@yahoo.co.uk] Sent: Tuesday, June 18, 2013 4:43 PM To: Joshua Tuttle Cc: xen-users@lists.xen.org Subject: Re: [Xen-users] DomU suspension/hibernation> > > Yeah this is new behavior. The only things I have changed so far are applying the patch and editing the xl.conf file to reflect "OUTPUT_FORMAT=sxp". > > Now I''m second guessing if I have applied the patch correctly. > > Here are the lines from the new file > > > Lines 32 -39 > > CMD=${SBINDIR}/xm > HEADCOMP="LinuxGuestRecord" > $CMD list &> /dev/null > If test $? -ne 0 > Then > CMD=${SBINDIR}/xl > HEADCOMP="Xen saved domain" > Fi > > > Line 260 > > If [ -f $dom ] ; then > > >Okay, line 262, then... not 260. Right, when I remove the sxp, it works find for one guest guests but I am also getting an issue with more than one guest.... Name ID Mem VCPUs State Time(s) Domain-0 0 1021 2 r----- 122.2 vpn2 9 192 1 -b---- 0.0 win 10 2037 2 -b---- 21.5 root@xen6:/etc/init.d# service xendomains stop Shutting down Xen domains: vpn2(save)..... vpn2(save).......................... win(save) An error occurred while saving domain: 10 is an invalid domain identifier (rc=-6) ! (shut) An error occurred while shutting down domain: 10 is an invalid domain identifier (rc=-6) ! * [done] root@xen6:/etc/init.d# ls /var/lib/xen/save vpn2 The two vpn2(save) are not good. root@xen6:/etc/init.d# ls -al /var/lib/xen/save total 2090892 drwxr-xr-x 2 root root 4096 Jun 18 21:25 . drwxr-xr-x 4 root root 4096 Jun 18 21:25 .. -rw-r--r-- 1 root root 2141058115 Jun 18 21:25 vpn2 Looks like the windows domain has been save with the wrong name. In fact, I can restore it manually and it is the HVM. Let me re-check my scripts. I may have used an old one by mistake. Here is line 262 If ["$HEADER" = "$HEADCOMP" ] ; then Echo -n " ${dom##*/}" The output of "service xendomains stop" is different from yours though. Even though it completes successfully it never says the name of the domain or the fact it was saved. It just gives this as output: "Shutting down Xen domains:[done]." When I run the "xl top" command it still shows my domain as running. ________________________________ This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc.
On Tue, Jun 18, 2013 at 3:42 PM, Ian Murray <murrayie@yahoo.co.uk> wrote:> > > >> >> Yeah this is new behavior. The only things I have changed so far are >> applying the patch and editing the xl.conf file to reflect >> "OUTPUT_FORMAT=sxp". >> >>Sorry for the confusion - The patch in question probably fixes the syntax issue that I notes on the vanilla 4.2.2. Regards, David _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On 18/06/13 22:07, David Sutton wrote:> On Tue, Jun 18, 2013 at 3:42 PM, Ian Murray <murrayie@yahoo.co.uk > <mailto:murrayie@yahoo.co.uk>> wrote: > > > > > > Yeah this is new behavior. The only things I have changed so > far are applying the patch and editing the xl.conf file to > reflect "OUTPUT_FORMAT=sxp". > > > Sorry for the confusion - The patch in question probably fixes the > syntax issue that I notes on the vanilla 4.2.2. > Regards, > > DavidIn fact, I wrote the patch. The only thing it does is look for a different header string in the SAVEd file if your using xl because it is saved differently by xl. It also adds some quotes around a string that can contains spaces, which caused errors. I think you''re right. xendomains is still broken as far as I can tell. I had this all working with non-JSON and some slight mods to the regex, but it seems that even that is broken now and it doesn''t work with JSON output if there is more than one domU. Damn! _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On 18/06/13 21:56, Joshua Tuttle wrote:> > -----Original Message----- > From: Ian Murray [mailto:murrayie@yahoo.co.uk] > Sent: Tuesday, June 18, 2013 4:43 PM > To: Joshua Tuttle > Cc: xen-users@lists.xen.org > Subject: Re: [Xen-users] DomU suspension/hibernation > > > >> >> Yeah this is new behavior. The only things I have changed so far are applying the patch and editing the xl.conf file to reflect "OUTPUT_FORMAT=sxp". >> >> Now I''m second guessing if I have applied the patch correctly. >> >> Here are the lines from the new file >> >> >> Lines 32 -39 >> >> CMD=${SBINDIR}/xm >> HEADCOMP="LinuxGuestRecord" >> $CMD list &> /dev/null >> If test $? -ne 0 >> Then >> CMD=${SBINDIR}/xl >> HEADCOMP="Xen saved domain" >> Fi >> >> >> Line 260 >> >> If [ -f $dom ] ; then >> >> >> > Okay, line 262, then... not 260. > > Right, when I remove the sxp, it works find for one guest guests but I am also getting an issue with more than one guest.... > > Name ID Mem VCPUs State Time(s) > Domain-0 0 1021 2 r----- 122.2 > vpn2 9 192 1 -b---- 0.0 > win 10 2037 2 -b---- 21.5 > root@xen6:/etc/init.d# service xendomains stop Shutting down Xen domains: vpn2(save)..... > vpn2(save).......................... > win(save) > An error occurred while saving domain: > 10 is an invalid domain identifier (rc=-6) > > ! > (shut) > An error occurred while shutting down domain: > 10 is an invalid domain identifier (rc=-6) > > ! > * [done] > root@xen6:/etc/init.d# ls /var/lib/xen/save > vpn2 > > > > The two vpn2(save) are not good. > > root@xen6:/etc/init.d# ls -al /var/lib/xen/save total 2090892 > drwxr-xr-x 2 root root 4096 Jun 18 21:25 . > drwxr-xr-x 4 root root 4096 Jun 18 21:25 .. > -rw-r--r-- 1 root root 2141058115 Jun 18 21:25 vpn2 > > > Looks like the windows domain has been save with the wrong name. In fact, I can restore it manually and it is the HVM. > > Let me re-check my scripts. I may have used an old one by mistake. > > > > > Here is line 262 > > If ["$HEADER" = "$HEADCOMP" ] ; then > Echo -n " ${dom##*/}" > > > The output of "service xendomains stop" is different from yours though. Even though it completes successfully it never says the name of the domain or the fact it was saved. It just gives this as output: "Shutting down Xen domains:[done]." When I run the "xl top" command it still shows my domain as running. >This suggests to me that it is not picking up the stuff from xl list -l . Did you trying removing the OUTPUT line from xl.conf? It''s somewhat moot because I think it is broken in any case for more than one domain using JSON format.> > > > ________________________________ > This message and all attachments are PRIVATE, and contain information that is PROPRIETARY to Intelligent Automation, Inc. You are not authorized to transmit or otherwise disclose this message or any attachments to any third party whatsoever without the express written consent of Intelligent Automation, Inc. If you received this message in error or you are not willing to view this message or any attachments on a confidential basis, please immediately delete this email and any attachments and notify Intelligent Automation, Inc.
Ian, On Tue, Jun 18, 2013 at 4:32 PM, Ian Murray <murrayie@yahoo.co.uk> wrote:> On 18/06/13 22:07, David Sutton wrote: > > On Tue, Jun 18, 2013 at 3:42 PM, Ian Murray <murrayie@yahoo.co.uk> wrote: > >> >> >> >>> >>> Yeah this is new behavior. The only things I have changed so far are >>> applying the patch and editing the xl.conf file to reflect >>> "OUTPUT_FORMAT=sxp". >>> >>> > Sorry for the confusion - The patch in question probably fixes the > syntax issue that I notes on the vanilla 4.2.2. > > Regards, > > David > > > > In fact, I wrote the patch. The only thing it does is look for a different > header string in the SAVEd file if your using xl because it is saved > differently by xl. It also adds some quotes around a string that can > contains spaces, which caused errors. > > I think you''re right. xendomains is still broken as far as I can tell. I > had this all working with non-JSON and some slight mods to the regex, but > it seems that even that is broken now and it doesn''t work with JSON output > if there is more than one domU. Damn! >Thanks for the clarification. I''m intending to test the latest RC tomorrow (and update the ArchLinux AUR package I use) so will take a look at xendomains then and see about what it would take to fix; i''m thinking that making use of xenstore-ls, xenstore-list and xenstore-read would work - so get all the domain ids, then extract out the necessary metadata fields for each one. Regards, David _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On 19/06/13 00:32, David Sutton wrote:> Ian, > > On Tue, Jun 18, 2013 at 4:32 PM, Ian Murray <murrayie@yahoo.co.uk > <mailto:murrayie@yahoo.co.uk>> wrote: > > On 18/06/13 22:07, David Sutton wrote: >> On Tue, Jun 18, 2013 at 3:42 PM, Ian Murray <murrayie@yahoo.co.uk >> <mailto:murrayie@yahoo.co.uk>> wrote: >> >> >> >> >> >> Yeah this is new behavior. The only things I have >> changed so far are applying the patch and editing the >> xl.conf file to reflect "OUTPUT_FORMAT=sxp". >> >> >> Sorry for the confusion - The patch in question probably fixes >> the syntax issue that I notes on the vanilla 4.2.2. >> Regards, >> >> David > > > In fact, I wrote the patch. The only thing it does is look for a > different header string in the SAVEd file if your using xl because > it is saved differently by xl. It also adds some quotes around a > string that can contains spaces, which caused errors. > > I think you''re right. xendomains is still broken as far as I can > tell. I had this all working with non-JSON and some slight mods to > the regex, but it seems that even that is broken now and it > doesn''t work with JSON output if there is more than one domU. Damn! > > > Thanks for the clarification. I''m intending to test the latest RC > tomorrow (and update the ArchLinux AUR package I use) so will take a > look at xendomains then and see about what it would take to fix; i''m > thinking that making use of xenstore-ls, xenstore-list and > xenstore-read would work - so get all the domain ids, then extract out > the necessary metadata fields for each one. > > Regards, > > DavidDavid, Glad you can make tomorrow. I can''t alas. I believe the reason why xendomains is failing for sxp format is because under 4.2.2 it appears that xl list -l is returning domid of -1 for all domU''s for some bizarre reason. I have a 4.1.x system and that is working correctly so that would appear as a regression. In terms of it running under JSON, I just think the regex needs a bit of a tweak, although it''s not happening (the tweak!) for me right now. It looks to me like it''s not properly picking up the { which is equivalent to the (domain part in sxp format. So I think it''s not clearing the name and id at the start of the domain data, so you briefly end up with previous domain name and the current domID combination which causes the foul-up. If it is just a regex tweak and there was to be another RC for 4.3 it would be nice to get this in. Xendomains seems to have been broken for so long now at least for xl, it would have been nice to have it working in a release and that''s were I thought we were, alas. A re-write would also be nice but tbh the only metadata it seems to need is name and id (and probably actually only needs id). Being dependant on formats of other commands isn''t great though, IMHO. Cheers, Ian M. _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Ian, On Tue, Jun 18, 2013 at 7:29 PM, Ian Murray <murrayie@yahoo.co.uk> wrote:> > David, > > Glad you can make tomorrow. I can''t alas. I believe the reason why > xendomains is failing for sxp format is because under 4.2.2 it appears > that xl list -l is returning domid of -1 for all domU''s for some bizarre > reason. I have a 4.1.x system and that is working correctly so that would > appear as a regression. > > In terms of it running under JSON, I just think the regex needs a bit of a > tweak, although it''s not happening (the tweak!) for me right now. It looks > to me like it''s not properly picking up the { which is equivalent to the > (domain part in sxp format. So I think it''s not clearing the name and id at > the start of the domain data, so you briefly end up with previous domain > name and the current domID combination which causes the foul-up. > > If it is just a regex tweak and there was to be another RC for 4.3 it > would be nice to get this in. Xendomains seems to have been broken for so > long now at least for xl, it would have been nice to have it working in a > release and that''s were I thought we were, alas. > > A re-write would also be nice but tbh the only metadata it seems to need > is name and id (and probably actually only needs id). Being dependant on > formats of other commands isn''t great though, IMHO. > > Cheers, > > Ian M. >Thanks for the information. I decided to have another look over xendomains on xen-4.2.2 this evening, as I decided I wanted it to work. There were a few interesting things broken in there - for example, I can''t see how the zombie testing code would work as neither formats of "xl list -l" give the state (and I couldn''t see how it would be trying to get that, even if it were) I managed to patch it so it was working for me. I rewrote most of the functions which had been using "xl list -l" to use "xenstore-list /local/domain" instead (which pulls a list of all the domain ids) and then replaced the call to parseln with a shell call to "xenstore-read /local/domain/$id/name". The one instance I didn''t change that in was the all_zombies function, which I just returned 0 since it would never be working right now anyway. I''ve attached a patch in case anyone else wants to see what I did, or make use of it. The other part of it, that i''m not completely happy with, is the assumption that xm == sxp and xl == json. I''m tempted to rewrite that part so that I capture the results to a variable, test for the presence of ''"name":'' then parse the variable through either sed (if sxp) or perl (if json - perl is being used as sed didn''t appear to have good support for the non-greedy regex modifier). Regards, David _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
On Tue, 2013-06-18 at 16:17 +0000, Joshua Tuttle wrote:> Will placing a symlink to my .cfg file in that directory save the > state of the domU or just have it automatically start when the > computer is rebooted?My understanding is that you only need file in auto if you want them to be booted along with the host and that the save/restore functionality is separate from this. Ian.
On Wed, 2013-06-19 at 03:04 -0500, David Sutton wrote:> Thanks for the information. I decided to have another look over > xendomains on xen-4.2.2 this evening, as I decided I wanted it to > work. There were a few interesting things broken in there - for > example, I can''t see how the zombie testing code would work as neither > formats of "xl list -l" give the state (and I couldn''t see how it > would be trying to get that, even if it were) > > > I managed to patch it so it was working for me. I rewrote most of the > functions which had been using "xl list -l" to use > "xenstore-list /local/domain" insteadThanks for doing this but I''m concerned that a change of this magnitude is too much for post rc5 of a release, assuming you were intending to propose this for 4.3 with a view to getting it backported to 4.2. We don''t generally take stuff directly into 4.2. If someone could find a targeted fix to the JSON parsing then that has a much higher chance of acceptance, I think. If we are going to rewrite this code for 4.4 (which is something I think I would support!) then I think it might be better to do it as "xl autosave" and "xl autorestore" rather than continuing to try and parse either JSON or SXP from a shell script (which is just a losing proposition really). Ian.
----- Original Message -----> From: Ian Campbell <Ian.Campbell@citrix.com> > To: David Sutton <kantras@gmail.com> > Cc: Ian Murray <murrayie@yahoo.co.uk>; "xen-users@lists.xen.org" <xen-users@lists.xen.org>; Joshua Tuttle <jtuttle@i-a-i.com> > Sent: Wednesday, 19 June 2013, 9:51 > Subject: Re: [Xen-users] DomU suspension/hibernation > > On Wed, 2013-06-19 at 03:04 -0500, David Sutton wrote: > > >> Thanks for the information. I decided to have another look over >> xendomains on xen-4.2.2 this evening, as I decided I wanted it to >> work. There were a few interesting things broken in there - for >> example, I can''t see how the zombie testing code would work as neither >> formats of "xl list -l" give the state (and I couldn''t see > how it >> would be trying to get that, even if it were) >> >> >> I managed to patch it so it was working for me. I rewrote most of the >> functions which had been using "xl list -l" to use >> "xenstore-list /local/domain" instead > > Thanks for doing this but I''m concerned that a change of this magnitude > is too much for post rc5 of a release, assuming you were intending to > propose this for 4.3 with a view to getting it backported to 4.2. We > don''t generally take stuff directly into 4.2. > > If someone could find a targeted fix to the JSON parsing then that has a > much higher chance of acceptance, I think. > > If we are going to rewrite this code for 4.4 (which is something I think > I would support!) then I think it might be better to do it as "xl > autosave" and "xl autorestore" rather than continuing to try and > parse > either JSON or SXP from a shell script (which is just a losing > proposition really). > > Ian. >Ian, I think I have this sorted now. The JSON "{" that is used to signify the start of domain data is preceeded with 4 spaces in the xl list -l output. Add those four spaces into the regex (needs to be exact otherwise there will be more unwanted matches, I think) and put quotes around the variable in the grep statement(s) and it works for me... so a 5 line patch or so. I will do more testing tonight and get a patch together if you are comfortable with the above in principle. There is still an issue with xl list -l giving bogus domid''s when using sxp format, but that''s for another day. Maybe that is fixed in 4.3 already. Cheers, Ian M.
On Wed, 2013-06-19 at 13:57 +0100, Ian Murray wrote:> I think I have this sorted now. The JSON "{" that is used to signify > the start of domain data is preceeded with 4 spaces in the xl list -l > output. Add those four spaces into the regex (needs to be exact > otherwise there will be more unwanted matches, I think) and put quotes > around the variable in the grep statement(s) and it works for me... so > a 5 line patch or so.Thanks, that sounds "good" (as in the best we can do within the confines of parsing JSON In shell...) I don''t think this commit went into 4.2: commit ac963eb7895b8351017bb6005505c2b176202f0e Author: Ian Campbell <ian.campbell@citrix.com> Date: Thu Aug 23 19:12:28 2012 +0100 xl: make "xl list -l" proper JSON Bastian Blank reports that the output of this command is just multiple JSON objects concatenated and is not a single properly formed JSON object. Fix this by wrapping in an array. This turned out to be a bit more intrusive than I was expecting due to the requirement to keep supporting the SXP output mode. Python''s json module is happy to parse the result... Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> but it is in 4.3, I can''t remember if it added any extra indentation or whatever but could you try it?> I will do more testing tonight and get a patch together if you are > comfortable with the above in principle. > > There is still an issue with xl list -l giving bogus domid''s when > using sxp format, but that''s for another day. Maybe that is fixed in > 4.3 already.This is an odd one, this sort of thing is sometimes down to a tools vs. hypervisor mismatch but if other stuff is working (like starting/stopping/suspending domains) then that doesn''t seem very likely. Looking at the diff from 4.2 to 4.3 this line in 4.2 looks very suspicious: if (default_output_format == OUTPUT_FORMAT_JSON) s = printf_info_one_json(hand, info[i].domid, &d_config); else printf_info_sexp(domid, &d_config); (note domid in one case, info[i].domid in the other). This ties in slightly with this fix, which I think is post 4.2, in terms of the confusion arising from using the global domid (which is likely not-initialised in this context): commit a73a7a0c647a9a5e30d8bc473c0a1e8648817183 Author: Ian Campbell <ian.campbell@citrix.com> Date: Mon Sep 17 11:17:02 2012 +0100 xl: Remove global domid and enable -Wshadow Lots of functions loop over a list of domain and others take a domid as a parameter, shadowing the global one and leading to all sorts of confusion. Therefore remove the global domid and explicitly pass it around as necessary. Adds a domid to the parameters for many functions and switches many others from taking a char * domain specifier to taking a domid, pushing the domid lookup to the toplevel. Replaces some open-coded domain_qualifier_to_domid error checking with find_domain. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> [ ijc -- annotate find_domain() with warn_unused_result and fix the handful of errors. ] Committed-by: Ian Campbell <ian.campbell@citrix.com> I don''t think we want to backport that whole thing but the hunk: @@ -2808,7 +2805,7 @@ static void list_domains_details(const libxl_dominfo *inf if (default_output_format == OUTPUT_FORMAT_JSON) s = printf_info_one_json(hand, info[i].domid, &d_config); else - printf_info_sexp(domid, &d_config); + printf_info_sexp(info[i].domid, &d_config); libxl_domain_config_dispose(&d_config); free(data); free(config_source); Looks like a good candidate. Can you give it a go? Ian.
----- Original Message -----> From: Ian Campbell <Ian.Campbell@citrix.com> > To: Ian Murray <murrayie@yahoo.co.uk> > Cc: David Sutton <kantras@gmail.com>; "xen-users@lists.xen.org" <xen-users@lists.xen.org>; Joshua Tuttle <jtuttle@i-a-i.com> > Sent: Wednesday, 19 June 2013, 14:16 > Subject: Re: [Xen-users] DomU suspension/hibernation > > On Wed, 2013-06-19 at 13:57 +0100, Ian Murray wrote: >> I think I have this sorted now. The JSON "{" that is used to > signify >> the start of domain data is preceeded with 4 spaces in the xl list -l >> output. Add those four spaces into the regex (needs to be exact >> otherwise there will be more unwanted matches, I think) and put quotes >> around the variable in the grep statement(s) and it works for me... so >> a 5 line patch or so. > > Thanks, that sounds "good" (as in the best we can do within the > confines > of parsing JSON In shell...) > > I don''t think this commit went into 4.2: > commit ac963eb7895b8351017bb6005505c2b176202f0e > Author: Ian Campbell <ian.campbell@citrix.com> > Date: Thu Aug 23 19:12:28 2012 +0100 > > xl: make "xl list -l" proper JSON > > Bastian Blank reports that the output of this command is just > multiple > JSON objects concatenated and is not a single properly formed JSON > object. > > Fix this by wrapping in an array. This turned out to be a bit more > intrusive than I was expecting due to the requirement to keep > supporting the SXP output mode. > > Python''s json module is happy to parse the result... > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com> > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> > > but it is in 4.3, I can''t remember if it added any extra indentation or > whatever but could you try it? >Okay, I can imagine that might make a difference, so needs to be done. Will add some delay as I had trouble with mixed versions when I tried to go to 4.3RC4 on Sunday and I am not there again til Friday. Might try again anyway as I have a KVM-over-IP attached to it, but y''know...>> I will do more testing tonight and get a patch together if you are >> comfortable with the above in principle. >> >> There is still an issue with xl list -l giving bogus domid''s when >> using sxp format, but that''s for another day. Maybe that is fixed in >> 4.3 already. > > This is an odd one, this sort of thing is sometimes down to a tools vs. > hypervisor mismatch but if other stuff is working (like > starting/stopping/suspending domains) then that doesn''t seem very > likely.This is happening on both my main Xen machines and they have both been upgraded from previous versions. One of them is quite new, so possibly only 4.2.1 previously. This is also happening to the original poster as he is getting the "invalid option 1" error which is xendomains trying to execute xl save -1 /file/name> > Looking at the diff from 4.2 to 4.3 this line in 4.2 looks very > suspicious: > if (default_output_format == OUTPUT_FORMAT_JSON) > s = printf_info_one_json(hand, info[i].domid, &d_config); > else > printf_info_sexp(domid, &d_config); > > (note domid in one case, info[i].domid in the other). This ties in > slightly with this fix, which I think is post 4.2, in terms of the > confusion arising from using the global domid (which is likely > not-initialised in this context): > > commit a73a7a0c647a9a5e30d8bc473c0a1e8648817183 > Author: Ian Campbell <ian.campbell@citrix.com> > Date: Mon Sep 17 11:17:02 2012 +0100 > > xl: Remove global domid and enable -Wshadow > > Lots of functions loop over a list of domain and others take a domid > as > a parameter, shadowing the global one and leading to all sorts of > confusion. > > Therefore remove the global domid and explicitly pass it around as > necessary. > > Adds a domid to the parameters for many functions and switches many > others from taking a char * domain specifier to taking a domid, > pushing > the domid lookup to the toplevel. > > Replaces some open-coded domain_qualifier_to_domid error checking > with > find_domain. > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com> > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> > [ ijc -- annotate find_domain() with warn_unused_result and fix the > handful of errors. ] > Committed-by: Ian Campbell <ian.campbell@citrix.com> > > I don''t think we want to backport that whole thing but the hunk: > @@ -2808,7 +2805,7 @@ static void list_domains_details(const > libxl_dominfo *inf > if (default_output_format == OUTPUT_FORMAT_JSON) > s = printf_info_one_json(hand, info[i].domid, > &d_config); > else > - printf_info_sexp(domid, &d_config); > + printf_info_sexp(info[i].domid, &d_config); > libxl_domain_config_dispose(&d_config); > free(data); > free(config_source); > > Looks like a good candidate. Can you give it a go? > > Ian. >Okay, will do.
Ian C, On Wed, Jun 19, 2013 at 8:16 AM, Ian Campbell <Ian.Campbell@citrix.com>wrote:> On Wed, 2013-06-19 at 13:57 +0100, Ian Murray wrote: > > I think I have this sorted now. The JSON "{" that is used to signify > > the start of domain data is preceeded with 4 spaces in the xl list -l > > output. Add those four spaces into the regex (needs to be exact > > otherwise there will be more unwanted matches, I think) and put quotes > > around the variable in the grep statement(s) and it works for me... so > > a 5 line patch or so. > > Thanks, that sounds "good" (as in the best we can do within the confines > of parsing JSON In shell...) > > I don''t think this commit went into 4.2: > commit ac963eb7895b8351017bb6005505c2b176202f0e > Author: Ian Campbell <ian.campbell@citrix.com> > Date: Thu Aug 23 19:12:28 2012 +0100 > > xl: make "xl list -l" proper JSON > > Bastian Blank reports that the output of this command is just > multiple > JSON objects concatenated and is not a single properly formed > JSON > object. > > Fix this by wrapping in an array. This turned out to be a bit > more > intrusive than I was expecting due to the requirement to keep > supporting the SXP output mode. > > Python''s json module is happy to parse the result... > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com> > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> > > but it is in 4.3, I can''t remember if it added any extra indentation or > whatever but could you try it? > > > I will do more testing tonight and get a patch together if you are > > comfortable with the above in principle. > > > > There is still an issue with xl list -l giving bogus domid''s when > > using sxp format, but that''s for another day. Maybe that is fixed in > > 4.3 already. > > This is an odd one, this sort of thing is sometimes down to a tools vs. > hypervisor mismatch but if other stuff is working (like > starting/stopping/suspending domains) then that doesn''t seem very > likely. > > Looking at the diff from 4.2 to 4.3 this line in 4.2 looks very > suspicious: > if (default_output_format == OUTPUT_FORMAT_JSON) > s = printf_info_one_json(hand, info[i].domid, &d_config); > else > printf_info_sexp(domid, &d_config); > > (note domid in one case, info[i].domid in the other). This ties in > slightly with this fix, which I think is post 4.2, in terms of the > confusion arising from using the global domid (which is likely > not-initialised in this context): > > commit a73a7a0c647a9a5e30d8bc473c0a1e8648817183 > Author: Ian Campbell <ian.campbell@citrix.com> > Date: Mon Sep 17 11:17:02 2012 +0100 > > xl: Remove global domid and enable -Wshadow > > Lots of functions loop over a list of domain and others take a > domid as > a parameter, shadowing the global one and leading to all sorts > of > confusion. > > Therefore remove the global domid and explicitly pass it > around as > necessary. > > Adds a domid to the parameters for many functions and switches > many > others from taking a char * domain specifier to taking a > domid, pushing > the domid lookup to the toplevel. > > Replaces some open-coded domain_qualifier_to_domid error > checking with > find_domain. > > Signed-off-by: Ian Campbell <ian.campbell@citrix.com> > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> > [ ijc -- annotate find_domain() with warn_unused_result and > fix the > handful of errors. ] > Committed-by: Ian Campbell <ian.campbell@citrix.com> > > I don''t think we want to backport that whole thing but the hunk: > @@ -2808,7 +2805,7 @@ static void list_domains_details(const > libxl_dominfo *inf > if (default_output_format == OUTPUT_FORMAT_JSON) > s = printf_info_one_json(hand, info[i].domid, > &d_config); > else > - printf_info_sexp(domid, &d_config); > + printf_info_sexp(info[i].domid, &d_config); > libxl_domain_config_dispose(&d_config); > free(data); > free(config_source); > > Looks like a good candidate. Can you give it a go? > > Ian. > > I just edited xl_cmdimpl.c by hand with the hunk listed in your email. Ican confirm that "xl list -l" now gives a valid domain id for each domain loaded, when outputting in sxp format. Regards, David _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Ian C, On Wed, Jun 19, 2013 at 3:51 AM, Ian Campbell <Ian.Campbell@citrix.com>wrote:> On Wed, 2013-06-19 at 03:04 -0500, David Sutton wrote: > > > > Thanks for the information. I decided to have another look over > > xendomains on xen-4.2.2 this evening, as I decided I wanted it to > > work. There were a few interesting things broken in there - for > > example, I can''t see how the zombie testing code would work as neither > > formats of "xl list -l" give the state (and I couldn''t see how it > > would be trying to get that, even if it were) > > > > > > I managed to patch it so it was working for me. I rewrote most of the > > functions which had been using "xl list -l" to use > > "xenstore-list /local/domain" instead > > Thanks for doing this but I''m concerned that a change of this magnitude > is too much for post rc5 of a release, assuming you were intending to > propose this for 4.3 with a view to getting it backported to 4.2. We > don''t generally take stuff directly into 4.2. > > If someone could find a targeted fix to the JSON parsing then that has a > much higher chance of acceptance, I think. > > If we are going to rewrite this code for 4.4 (which is something I think > I would support!) then I think it might be better to do it as "xl > autosave" and "xl autorestore" rather than continuing to try and parse > either JSON or SXP from a shell script (which is just a losing > proposition really). > > Ian. > > > The patch was provided as a proof of concept of a way for xendomains tobe able to handle scaning through multiple domains without having to try and jump through hoops getting bash script to manipulate json data retrieved from "xl list -l" - xendomains uses that function for more than just domain save/restore functions, its also used in status checking as well. Use if and/or when it seems right. Regards, David _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
>________________________________ > From: David Sutton <kantras@gmail.com> >To: Ian Campbell <Ian.Campbell@citrix.com> >Cc: Ian Murray <murrayie@yahoo.co.uk>; "xen-users@lists.xen.org" <xen-users@lists.xen.org>; Joshua Tuttle <jtuttle@i-a-i.com> >Sent: Wednesday, 19 June 2013, 15:15 >Subject: Re: [Xen-users] DomU suspension/hibernation > > > >Ian C, > > > >On Wed, Jun 19, 2013 at 8:16 AM, Ian Campbell <Ian.Campbell@citrix.com> wrote: > >On Wed, 2013-06-19 at 13:57 +0100, Ian Murray wrote: >>> I think I have this sorted now. The JSON "{" that is used to signify >>> the start of domain data is preceeded with 4 spaces in the xl list -l >>> output. Add those four spaces into the regex (needs to be exact >>> otherwise there will be more unwanted matches, I think) and put quotes >>> around the variable in the grep statement(s) and it works for me... so >>> a 5 line patch or so. >> >>Thanks, that sounds "good" (as in the best we can do within the confines >>of parsing JSON In shell...) >> >>I don''t think this commit went into 4.2: >> commit ac963eb7895b8351017bb6005505c2b176202f0e >> Author: Ian Campbell <ian.campbell@citrix.com> >> Date: Thu Aug 23 19:12:28 2012 +0100 >> >> xl: make "xl list -l" proper JSON >> >> Bastian Blank reports that the output of this command is just multiple >> JSON objects concatenated and is not a single properly formed JSON >> object. >> >> Fix this by wrapping in an array. This turned out to be a bit more >> intrusive than I was expecting due to the requirement to keep >> supporting the SXP output mode. >> >> Python''s json module is happy to parse the result... >> >> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> >> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> >> >>but it is in 4.3, I can''t remember if it added any extra indentation or >>whatever but could you try it? >> >> >>> I will do more testing tonight and get a patch together if you are >>> comfortable with the above in principle. >>> >>> There is still an issue with xl list -l giving bogus domid''s when >>> using sxp format, but that''s for another day. Maybe that is fixed in >>> 4.3 already. >> >>This is an odd one, this sort of thing is sometimes down to a tools vs. >>hypervisor mismatch but if other stuff is working (like >>starting/stopping/suspending domains) then that doesn''t seem very >>likely. >> >>Looking at the diff from 4.2 to 4.3 this line in 4.2 looks very >>suspicious: >> if (default_output_format == OUTPUT_FORMAT_JSON) >> s = printf_info_one_json(hand, info[i].domid, &d_config); >> else >> printf_info_sexp(domid, &d_config); >> >>(note domid in one case, info[i].domid in the other). This ties in >>slightly with this fix, which I think is post 4.2, in terms of the >>confusion arising from using the global domid (which is likely >>not-initialised in this context): >> >> commit a73a7a0c647a9a5e30d8bc473c0a1e8648817183 >> Author: Ian Campbell <ian.campbell@citrix.com> >> Date: Mon Sep 17 11:17:02 2012 +0100 >> >> xl: Remove global domid and enable -Wshadow >> >> Lots of functions loop over a list of domain and others take a domid as >> a parameter, shadowing the global one and leading to all sorts of >> confusion. >> >> Therefore remove the global domid and explicitly pass it around as >> necessary. >> >> Adds a domid to the parameters for many functions and switches many >> others from taking a char * domain specifier to taking a domid, pushing >> the domid lookup to the toplevel. >> >> Replaces some open-coded domain_qualifier_to_domid error checking with >> find_domain. >> >> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> >> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> >> [ ijc -- annotate find_domain() with warn_unused_result and fix the >> handful of errors. ] >> Committed-by: Ian Campbell <ian.campbell@citrix.com> >> >>I don''t think we want to backport that whole thing but the hunk: >> @@ -2808,7 +2805,7 @@ static void list_domains_details(const libxl_dominfo *inf >> if (default_output_format == OUTPUT_FORMAT_JSON) >> s = printf_info_one_json(hand, info[i].domid, &d_config); >> else >> - printf_info_sexp(domid, &d_config); >> + printf_info_sexp(info[i].domid, &d_config); >> libxl_domain_config_dispose(&d_config); >> free(data); >> free(config_source); >> >>Looks like a good candidate. Can you give it a go? >> >>Ian. >> >> I just edited xl_cmdimpl.c by hand with the hunk listed in your email. I can confirm that "xl list -l" now gives a valid domain id for each domain loaded, when outputting in sxp format. > > >Regards, > > David > >I''ve just done the same and it also works for me. Stock 4.2.2 xendomains still has an issue with sxp format it would seem.... Similar behaviour to what happens with JSON. Presumably another (seperate) issue with regex. I know I had problems with the regex and wrote a patch but that problem went away. I now realise this was probably due to default going to JSON, Will have to dig out my 2011 patch and re-visit it. (SXP run) root@xen6:~/xensource/xen# service xendomains stop Shutting down Xen domains: ubuntu-email(save)................... ubuntu-email(save).... vpn2(save) An error occurred while saving domain: 31 is an invalid domain identifier (rc=-6) ! (shut) An error occurred while shutting down domain: 31 is an invalid domain identifier (rc=-6) ! * [done]>
Ian M, On Wed, Jun 19, 2013 at 9:59 AM, Ian Murray <murrayie@yahoo.co.uk> wrote:> > I''ve just done the same and it also works for me. > > Stock 4.2.2 xendomains still has an issue with sxp format it would > seem.... Similar behaviour to what happens with JSON. Presumably another > (seperate) issue with regex. I know I had problems with the regex and wrote > a patch but that problem went away. I now realise this was probably due to > default going to JSON, Will have to dig out my 2011 patch and re-visit it. > > > (SXP run) > root@xen6:~/xensource/xen# service xendomains stop > Shutting down Xen domains: ubuntu-email(save)................... > ubuntu-email(save).... > vpn2(save) > An error occurred while saving domain: > 31 is an invalid domain identifier (rc=-6) > > ! > (shut) > An error occurred while shutting down domain: > 31 is an invalid domain identifier (rc=-6) > > ! > * [done] > > > >Try changing the LIST_GREP line to read: LIST_GREP=''^(domain$\|(domid\|(name\|^{$\|"name":\|"domid":'' "xl list -l", using sxp output, starts each new domain with "(domain", not "((domain". This meant that the old domid wasn''t being cleared from the id variable whenever the parser moved onto a new domain. Regards, David _______________________________________________ Xen-users mailing list Xen-users@lists.xen.org http://lists.xen.org/xen-users
Reasonably Related Threads
- [Patch[ xl problems with xendomains
- Xen 4.2.2 /etc/init.d/xendomains save and restore of domains does not work
- [PATCH] [Backport 4.2.x] Fix issue with 'xl list -l' showing domids as -1 when using SXP
- Xen 4.2.1 unable to get domain type for domid
- [PATCH 0 of 2 v2] Add vncviewer xm compatibility options