[libvirt] domain shutdown requests

When you shutdown a domain that is in PAUSED state, the shutdown will not take effect until you issue a resume cmd: # virsh suspend <domain_name> <domain_name> is now PAUSED # virsh shutdown <domain_name> <domain_name> does not shutdown, with the reason being that, for example in the case of a Linux Guest, the guest is not running and therefore there is no acpid running and able to process the shutdown request. Right? If now we issue a resume #virsh resume <domain_name> the guest initiates the (pending) shutdown (ie, acpid processes the pending request). Is this the expected behavior? Shouldn't virsh do something like this when it issues a shutdown request? if (domain.state == PAUSED) resume(domain) shutdown(domain) If yes, then I guess this logic should go - into the cmdShutdown routine if we want to make it available to virsh only, or - inside the driver's domainShutdown fn if we want to make it available to any libvirt user. One more minor comment. As of now, "virsh list" (or 'virsh domstate <domain>') does not provide any way of knowing if - a domain is being shutdown or - a domain has a pending shutdown request (like in the example above). Would it make any sense to enhance the output of list/domstate , for example to show something like this when libvirt issues a shutdown to a running domain Id Name State ---------------------------------- 3 FC15-2 running (shutdown in progress) Or something like this when it issues a shutdown to a PAUSED domain? Id Name State ---------------------------------- 3 FC15-2 PAUSED (shutdown request pending) Thanks /Chris

At 09/16/2011 05:10 AM, Christian Benvenuti (benve) Write:
When you shutdown a domain that is in PAUSED state, the shutdown will not take effect until you issue a resume cmd:
# virsh suspend <domain_name>
<domain_name> is now PAUSED
# virsh shutdown <domain_name>
<domain_name> does not shutdown, with the reason being that, for example in the case of a Linux Guest, the guest is not running and therefore there is no acpid running and able to process the shutdown request. Right?
If now we issue a resume
#virsh resume <domain_name>
the guest initiates the (pending) shutdown (ie, acpid processes the pending request).
I test it, and the guest is not shutdown after I resume the guest.
Is this the expected behavior?
Shouldn't virsh do something like this when it issues a shutdown request?
if (domain.state == PAUSED) resume(domain)
shutdown(domain)
If yes, then I guess this logic should go - into the cmdShutdown routine if we want to make it available to virsh only, or - inside the driver's domainShutdown fn if we want to make it available to any libvirt user.
One more minor comment. As of now, "virsh list" (or 'virsh domstate <domain>') does not provide any way of knowing if - a domain is being shutdown or - a domain has a pending shutdown request (like in the example above).
Would it make any sense to enhance the output of list/domstate , for example to show something like this when libvirt issues a shutdown to a running domain
Id Name State ---------------------------------- 3 FC15-2 running (shutdown in progress)
Or something like this when it issues a shutdown to a PAUSED domain?
Id Name State ---------------------------------- 3 FC15-2 PAUSED (shutdown request pending)
The request is not pended... I perfer to resume the guest before shutdown it in ther driver. Thanks Wen Congyang
Thanks /Chris
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

-----Original Message----- From: Wen Congyang [mailto:wency@cn.fujitsu.com] Sent: Thursday, September 15, 2011 6:22 PM To: Christian Benvenuti (benve) Cc: Libvirt Subject: Re: [libvirt] domain shutdown requests
When you shutdown a domain that is in PAUSED state, the shutdown will not take effect until you issue a resume cmd:
# virsh suspend <domain_name>
<domain_name> is now PAUSED
# virsh shutdown <domain_name>
<domain_name> does not shutdown, with the reason being that, for example in the case of a Linux Guest, the guest is not running and therefore there is no acpid running and able to process the shutdown request. Right?
If now we issue a resume
#virsh resume <domain_name>
the guest initiates the (pending) shutdown (ie, acpid processes
At 09/16/2011 05:10 AM, Christian Benvenuti (benve) Write: the
pending request).
I test it, and the guest is not shutdown after I resume the guest.
I (re)tested it with 0.9.4 and it does shutdown.
Is this the expected behavior?
Shouldn't virsh do something like this when it issues a shutdown request?
if (domain.state == PAUSED) resume(domain)
shutdown(domain)
If yes, then I guess this logic should go - into the cmdShutdown routine if we want to make it available to virsh only, or - inside the driver's domainShutdown fn if we want to make it available to any libvirt user.
One more minor comment. As of now, "virsh list" (or 'virsh domstate <domain>') does not provide any way of knowing if - a domain is being shutdown or - a domain has a pending shutdown request (like in the example above).
Would it make any sense to enhance the output of list/domstate , for example to show something like this when libvirt issues a shutdown to a running domain
Id Name State ---------------------------------- 3 FC15-2 running (shutdown in progress)
Or something like this when it issues a shutdown to a PAUSED domain?
Id Name State ---------------------------------- 3 FC15-2 PAUSED (shutdown request pending)
The request is not pended...
In my test it is: as soon as I do "resume", the guest initiates the shutdown.
I perfer to resume the guest before shutdown it in ther driver.
In this case the shutdown command should return something like "Domain XXX is in PAUSED state. You need to resume it first..." instead of "Domain XXX is being shutdown". /Chris
Thanks Wen Congyang
Thanks /Chris
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

At 09/16/2011 09:36 AM, Christian Benvenuti (benve) Write:
-----Original Message----- From: Wen Congyang [mailto:wency@cn.fujitsu.com] Sent: Thursday, September 15, 2011 6:22 PM To: Christian Benvenuti (benve) Cc: Libvirt Subject: Re: [libvirt] domain shutdown requests
When you shutdown a domain that is in PAUSED state, the shutdown will not take effect until you issue a resume cmd:
# virsh suspend <domain_name>
<domain_name> is now PAUSED
# virsh shutdown <domain_name>
<domain_name> does not shutdown, with the reason being that, for example in the case of a Linux Guest, the guest is not running and therefore there is no acpid running and able to process the shutdown request. Right?
If now we issue a resume
#virsh resume <domain_name>
the guest initiates the (pending) shutdown (ie, acpid processes
At 09/16/2011 05:10 AM, Christian Benvenuti (benve) Write: the
pending request).
I test it, and the guest is not shutdown after I resume the guest.
I (re)tested it with 0.9.4 and it does shutdown.
The bevaior does not depend libvirt. It depends qemu. What is the version of qemu that you used? Thanks Wen Congyang.
Is this the expected behavior?
Shouldn't virsh do something like this when it issues a shutdown request?
if (domain.state == PAUSED) resume(domain)
shutdown(domain)
If yes, then I guess this logic should go - into the cmdShutdown routine if we want to make it available to virsh only, or - inside the driver's domainShutdown fn if we want to make it available to any libvirt user.
One more minor comment. As of now, "virsh list" (or 'virsh domstate <domain>') does not provide any way of knowing if - a domain is being shutdown or - a domain has a pending shutdown request (like in the example above).
Would it make any sense to enhance the output of list/domstate , for example to show something like this when libvirt issues a shutdown to a running domain
Id Name State ---------------------------------- 3 FC15-2 running (shutdown in progress)
Or something like this when it issues a shutdown to a PAUSED domain?
Id Name State ---------------------------------- 3 FC15-2 PAUSED (shutdown request pending)
The request is not pended...
In my test it is: as soon as I do "resume", the guest initiates the shutdown.
I perfer to resume the guest before shutdown it in ther driver.
In this case the shutdown command should return something like
"Domain XXX is in PAUSED state. You need to resume it first..."
instead of
"Domain XXX is being shutdown".
/Chris
Thanks Wen Congyang
Thanks /Chris
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

-----Original Message----- From: Wen Congyang [mailto:wency@cn.fujitsu.com] Sent: Thursday, September 15, 2011 6:42 PM To: Christian Benvenuti (benve) Cc: Libvirt Subject: Re: [libvirt] domain shutdown requests
At 09/16/2011 09:36 AM, Christian Benvenuti (benve) Write:
-----Original Message----- From: Wen Congyang [mailto:wency@cn.fujitsu.com] Sent: Thursday, September 15, 2011 6:22 PM To: Christian Benvenuti (benve) Cc: Libvirt Subject: Re: [libvirt] domain shutdown requests
When you shutdown a domain that is in PAUSED state, the shutdown will not take effect until you issue a resume cmd:
# virsh suspend <domain_name>
<domain_name> is now PAUSED
# virsh shutdown <domain_name>
<domain_name> does not shutdown, with the reason being that, for example in the case of a Linux Guest, the guest is not running and therefore there is no acpid running and able to process the shutdown request. Right?
If now we issue a resume
#virsh resume <domain_name>
the guest initiates the (pending) shutdown (ie, acpid processes
At 09/16/2011 05:10 AM, Christian Benvenuti (benve) Write: the
pending request).
I test it, and the guest is not shutdown after I resume the guest.
I (re)tested it with 0.9.4 and it does shutdown.
The bevaior does not depend libvirt. It depends qemu. What is the version of qemu that you used?
0.14.0 (default on FC15). Has anything changed on this in the newer releases? /Chris
Thanks Wen Congyang.
Is this the expected behavior?
Shouldn't virsh do something like this when it issues a shutdown request?
if (domain.state == PAUSED) resume(domain)
shutdown(domain)
If yes, then I guess this logic should go - into the cmdShutdown routine if we want to make it available to virsh only, or - inside the driver's domainShutdown fn if we want to make it available to any libvirt user.
One more minor comment. As of now, "virsh list" (or 'virsh domstate <domain>') does not provide any way of knowing if - a domain is being shutdown or - a domain has a pending shutdown request (like in the example above).
Would it make any sense to enhance the output of list/domstate ,
for
example to show something like this when libvirt issues a shutdown to a running domain
Id Name State ---------------------------------- 3 FC15-2 running (shutdown in progress)
Or something like this when it issues a shutdown to a PAUSED domain?
Id Name State ---------------------------------- 3 FC15-2 PAUSED (shutdown request pending)
The request is not pended...
In my test it is: as soon as I do "resume", the guest initiates the shutdown.
I perfer to resume the guest before shutdown it in ther driver.
In this case the shutdown command should return something like
"Domain XXX is in PAUSED state. You need to resume it first..."
instead of
"Domain XXX is being shutdown".
/Chris
Thanks Wen Congyang
Thanks /Chris
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

From the real physical usage case, the user can not shutdown a suspended OS before the OS is resumed. That is what Linux and Windows does now. And the user will get a interactive pop-up window before the request is confirmed. So in virtualized enviroment, it is better to resume the guest OS first. However, whether to shutdown the OS directly after resume or requiring a second shutdown is arguable. Christian Benvenuti (benve):
When you shutdown a domain that is in PAUSED state, the shutdown will not take effect until you issue a resume cmd:
# virsh suspend<domain_name>
<domain_name> is now PAUSED
# virsh shutdown<domain_name>
<domain_name> does not shutdown, with the reason being that, for example in the case of a Linux Guest, the guest is not running and therefore there is no acpid running and able to process the shutdown request. Right?
If now we issue a resume
#virsh resume<domain_name>
the guest initiates the (pending) shutdown (ie, acpid processes the pending request).
Is this the expected behavior?
Shouldn't virsh do something like this when it issues a shutdown request?
if (domain.state == PAUSED) resume(domain)
shutdown(domain)
If yes, then I guess this logic should go - into the cmdShutdown routine if we want to make it available to virsh only, or - inside the driver's domainShutdown fn if we want to make it available to any libvirt user.
One more minor comment. As of now, "virsh list" (or 'virsh domstate<domain>') does not provide any way of knowing if - a domain is being shutdown or - a domain has a pending shutdown request (like in the example above).
Would it make any sense to enhance the output of list/domstate , for example to show something like this when libvirt issues a shutdown to a running domain
Id Name State ---------------------------------- 3 FC15-2 running (shutdown in progress)
Or something like this when it issues a shutdown to a PAUSED domain?
Id Name State ---------------------------------- 3 FC15-2 PAUSED (shutdown request pending)
Thanks /Chris
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
participants (3)
-
Christian Benvenuti (benve)
-
shu ming
-
Wen Congyang