WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] Re: Need some help with 'suspended' state

To: jfehlig@xxxxxxxxxx
Subject: [Xen-API] Re: Need some help with 'suspended' state
From: Tom Wilkie <tom.wilkie@xxxxxxxxx>
Date: Fri, 20 Apr 2007 14:40:23 +0100
Cc: Tom Wilkie <tom.wilkie@xxxxxxxxx>, xen-api@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 20 Apr 2007 08:50:27 -0700
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:from:subject:date:to:x-mailer; b=eK4SAqruEz05/grvKHiNSC3ciSc+0aROqz8z0sJgQyyv/XfxErP7Jw8R5BPkb1iLYIsNNSHMCYgsEKux+eb9+sXRb/+WtzJUSjNc2/Q3+5Q/Ag+QIudzlTU9W+bnZ9RMtQsGh61foAhJwtF4eLCvgL6EM5ir+n136Bwi6aKU+LY=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:from:subject:date:to:x-mailer; b=R4et+EG1p5Lq88dBMSHK16RXmPROl3U36wb7PZ9Bu14IYSDEpK1PgZeQKercJppBXwDHrWRah+m7LiUeKaBdhPAeOoJWouH8BnjYCFC2Mrd4f1LlzBYVP5cJ0uR0pILdakHH0qdQR1DaJoymh43Yf4x9TbDnZ4ZO5awHEPlnb0c=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070410102317.GB31206@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <20070410102317.GB31206@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Jim,

Please find attached a patch against 14881 to fix this problem.  State should now accurately reflect the real state of a VM.  I'm currently doing tests / regressions on this patch before I commit, but if all goes okay it should be in unstable today.

Cheers

Tom

Attachment: newstate.diff
Description: Binary data


On 10 Apr 2007, at 11:23, Ewan Mellor wrote:


From: Jim Fehlig <jfehlig@xxxxxxxxxx>
Date: 8 March 2007 00:19:53 GMT
To: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Cc: Gareth S Bestor <bestorga@xxxxxxxxxx>,  "Subrahmanian, Raj" <raj.subrahmanian@xxxxxxxxxx>
Subject: Need some help with 'suspended' state


Ewan,

I'm having problems resuming a domain after invoking VM.suspend via CIM
providers.  Problem is in CIM world you move a vm from suspended to
active by calling RequestStateChange method on the vm.  One also moves a
vm from paused to active and inactive to active using the same method
with same parameter value.  So in the Xen CIM providers I first get vm
record and then call appropriate VM.resume, VM.unpause, or VM.start
depending on VM.power_state.  But VM.power_state == HALTED for a vm just
suspended - thus provider calls VM.start :-(.

This appears to be the case in xen-unstable as well.  In fact,
domain_resume in XendDomain.py checks that vm is halted:

                if dominfo.state != DOM_STATE_HALTED:
                    raise XendError("Cannot resume domain that is not
halted.")

which obviously needs to change once state of suspended is properly
reflected.

In need to get this working properly in SP1 tools stack but after
spending some time playing with the code I have not arrived at a
solution.  As you can see in the attached xend.log snippet,
refreshShutdown in XendDomainInfo is called several times during
execution of 'xm suspend dom'.  On the last call, we set state of domain
to SHUTDOWN and then follow this with setting state to HALTED in
cleanupDomain.  I'm not even sure if the fact that this domain is being
suspended is known and available within this last call to
cleanupDomain.  Any thoughts on how I can get to a VM.power_state of
suspended from here?

Thanks,
Jim
[2007-03-07 17:10:18 xend 6463] DEBUG (XendCheckpoint:80) [xc_save]: /usr/lib/xen/bin/xc_save 20 4 0 0 0
[2007-03-07 17:10:18 xend.XendDomainInfo 6463] DEBUG (XendDomainInfo:788) Storing domain details: {'console/ring-ref': '276658', 'console/port': '2', 'name': 'migrating-sles10-1', 'console/limit': '1048576', 'vm': '/vm/2f5f5e84-e695-904c-79b3-2695fe5226d0', 'domid': '4', 'cpu/0/availability': 'online', 'memory/target': '524288', 'store/ring-ref': '276659', 'store/port': '1'}
[2007-03-07 17:10:18 xend 6463] DEBUG (XendCheckpoint:218) suspend
[2007-03-07 17:10:18 xend 6463] DEBUG (XendCheckpoint:83) In saveInputHandler suspend
[2007-03-07 17:10:18 xend 6463] DEBUG (XendCheckpoint:85) Suspending 4 ...
[2007-03-07 17:10:18 xend.XendDomainInfo 6463] DEBUG (XendDomainInfo:421) XendDomainInfo.shutdown
[2007-03-07 17:10:18 xend.XendDomainInfo 6463] DEBUG (XendDomainInfo:855) XendDomainInfo.handleShutdownWatch
[2007-03-07 17:10:18 xend.XendDomainInfo 6463] DEBUG (XendDomainInfo:855) XendDomainInfo.handleShutdownWatch
[2007-03-07 17:10:18 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1059) ##### refreshShutdown: calling _stateSet(DOM_STATE_RUNNING)
[2007-03-07 17:10:18 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1813) ##### _stateSet: state = 2
[2007-03-07 17:10:18 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1019) ##### refreshShutdown: calling _stateSet(DOM_STATE_SHUTDOWN)
[2007-03-07 17:10:18 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1813) ##### _stateSet: state = 4
[2007-03-07 17:10:18 xend 6463] INFO (XendCheckpoint:90) Domain 4 suspended.
[2007-03-07 17:10:18 xend 6463] DEBUG (XendCheckpoint:95) Written done
[2007-03-07 17:10:18 xend.XendDomainInfo 6463] INFO (XendDomainInfo:1030) Domain has shutdown: name=migrating-sles10-1 id=4 reason=suspend.
[2007-03-07 17:10:18 xend 6463] INFO (XendCheckpoint:247) Had 0 unexplained entries in p2m table
[2007-03-07 17:10:18 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1035) ##### refreshShutdown: calling _stateSet(DOM_STATE_SUSPENDED)
[2007-03-07 17:10:18 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1813) ##### _stateSet: state = 3
 1: sent 131072, skipped 0, delta 5126ms, dom0 6%, target 0%, sent 837Mb/s, dirtied 785Mb/s -1208885260 pages
[2007-03-07 17:10:23 xend 6463] INFO (XendCheckpoint:247) Total pages sent= 131072 (0.98x)
[2007-03-07 17:10:23 xend 6463] INFO (XendCheckpoint:247) (of which 0 were fixups)
[2007-03-07 17:10:23 xend 6463] INFO (XendCheckpoint:247) All memory is saved
[2007-03-07 17:10:23 xend 6463] INFO (XendCheckpoint:247) Save exit rc=0
[2007-03-07 17:10:23 xend.XendDomainInfo 6463] DEBUG (XendDomainInfo:1565) XendDomainInfo.destroyDomain(4)
[2007-03-07 17:10:23 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1059) ##### refreshShutdown: calling _stateSet(DOM_STATE_RUNNING)
[2007-03-07 17:10:23 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1813) ##### _stateSet: state = 2
[2007-03-07 17:10:25 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1499) ##### cleanupDomain: calling _stateSet HALTED
[2007-03-07 17:10:25 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1813) ##### _stateSet: state = 0
[2007-03-07 17:10:25 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1499) ##### cleanupDomain: calling _stateSet HALTED
[2007-03-07 17:10:25 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1813) ##### _stateSet: state = 0
[2007-03-07 17:10:25 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:998) ##### refreshShutdown: calling _stateSet(DOM_STATE_SHUTDOWN)
[2007-03-07 17:10:25 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1813) ##### _stateSet: state = 4
[2007-03-07 17:10:25 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1499) ##### cleanupDomain: calling _stateSet HALTED
[2007-03-07 17:10:25 xend.XendDomainInfo 6463] WARNING (XendDomainInfo:1813) ##### _stateSet: state = 0




_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-API] Re: Need some help with 'suspended' state, Tom Wilkie <=