Bug 589465 - [RFE] start a domain in paused mode
[RFE] start a domain in paused mode
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
All Linux
medium Severity medium
: rc
: 6.0
Assigned To: Eric Blake
Virtualization Bugs
vdsm & libvirt integration
: FutureFeature
Depends On:
Blocks: 589458
  Show dependency treegraph
Reported: 2010-05-06 04:50 EDT by Dan Kenigsberg
Modified: 2010-11-11 09:48 EST (History)
14 users (show)

See Also:
Fixed In Version: libvirt-0_8_1-11_el6
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 589458
Last Closed: 2010-11-11 09:48:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
1/3 - add new flag (11.19 KB, patch)
2010-06-08 18:15 EDT, Eric Blake
no flags Details | Diff
2/3 - use flag for qemu (5.39 KB, patch)
2010-06-08 18:17 EDT, Eric Blake
no flags Details | Diff
3/3 - expose new flag in virsh (2.24 KB, patch)
2010-06-08 18:17 EDT, Eric Blake
no flags Details | Diff

  None (edit)
Description Dan Kenigsberg 2010-05-06 04:50:47 EDT
+++ This bug was initially created as a clone of Bug #589458 +++

Description of problem:

Some guests (eg with badly configured grub, or Windows' installation cd) require quick response from the console user. That's why we have a "launchPaused" option in vdsm.

To implement it via libvirt, we need to ask libvirt not to call qemuMonitorStartCPUs() after starting qemu.

If this RFE is not implemented, vdsm will have to resort to calling virDomainStop immediately after the domain is up, but this is inherently raceful.
Comment 1 RHEL Product and Program Management 2010-05-06 05:36:00 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
Comment 2 RHEL Product and Program Management 2010-05-06 06:51:11 EDT
This feature request did not get resolved in time for Feature Freeze
for the current Red Hat Enterprise Linux release and has now been
denied. You may re-open your request by requesting your support
representative to propose it for the next release.
Comment 3 Daniel Veillard 2010-05-11 05:19:00 EDT
This should be doable for virDomainCreateXML API which has a flags argument
but the virDomainCreate() counterpart has no such flags, so adding this to
defined domains would require too much work for RHEL-6.0.

Comment 4 Hugh Brock 2010-05-18 12:57:46 EDT
We should go ahead and fix the transient domain case (virDomainCreateXML) for VDSM.
Comment 5 Eric Blake 2010-06-08 16:01:23 EDT
Upstream patch series posted:
Comment 6 Eric Blake 2010-06-08 18:15:34 EDT
Created attachment 422372 [details]
1/3 - add new flag
Comment 7 Eric Blake 2010-06-08 18:17:24 EDT
Created attachment 422373 [details]
2/3 - use flag for qemu

Note - backport had merge conflict, unless upstream patch 2b57478ef0a0a983 is applied first (Jamie Strandboge, * Add stdin_path to qemudStartVMDaemon() args.)  The attached file has the merge conflict resolved.
Comment 8 Eric Blake 2010-06-08 18:17:56 EDT
Created attachment 422374 [details]
3/3 - expose new flag in virsh
Comment 9 Eric Blake 2010-06-09 10:32:41 EDT
Per upstream review, I am working on adding the virDomainCreateFlags() API; the question is whether this new API needs to be backported to RHEL 6.0, or whether it can wait for 6.1 (leaving just the first 3 patches to virDomainCreateXML for inclusion in 6.0).

Comment 10 Eric Blake 2010-06-10 09:18:53 EDT
We've painted ourselves into a bit of a corner.  We already have the public typedef enum virDomainCreateFlags, so the new API has to be named something different (perhaps virDomainCreateWithFlags or virDomainCreate2).
Comment 12 Dave Allan 2010-06-16 16:48:58 EDT
libvirt-0_8_1-9_el6 has been built in RHEL-6-candidate with the fix.

Comment 13 Dan Kenigsberg 2010-06-24 15:09:42 EDT
libvirt-python-0.8.1-10.el6.x86_64: python binding is missing VIR_DOMAIN_START_PAUSED.
Comment 14 Eric Blake 2010-06-25 08:37:30 EDT
On IRC, Matthias pointed out that there was a partial dependency problem introduced in upstream commit a79fb1c491197a91094c that may impact the rebuild rules for python bindings.  I'm looking further into the issue, and hope to figure out if that same issue applies to the RHEL6 build.
Comment 16 Dave Allan 2010-06-28 23:00:52 EDT
libvirt-0_8_1-11_el6 has been built in RHEL-6-candidate with the fix.

Comment 18 weizhang 2010-07-22 07:57:57 EDT
On testing, I follow the steps:
1. start a domain with
# virsh start demo
Domain demo started

2. After demo started, pause the demo
# virsh suspend demo
Domain demo suspended

# virsh list --all
Id Name                 State
 23 demo               paused

3 Start the demo
# virsh start demo
error: Domain is already active

# virsh list --all
Id Name                 State
 23 demo               paused

Is that the expected result?

# rpm -qa libvirt
kernel 2.6.32-44.2.el6.x86_64
Comment 19 Eric Blake 2010-07-22 08:17:33 EDT
Using 'virsh start' cannot exercise the new functionality, since RHEL6 does not support starting a persistent guest in the paused state.  To test this, you need to use a transient domain, via:

virsh create dom.xml [--create]
virsh list --all

and verify that omitting --create shows the transient domain as running, while including --create shows the transient domain as paused.
Comment 20 weizhang 2010-07-22 22:42:41 EDT
Thanks Eric. I change the step according to your advice:

#virsh create dom.xml --paused
Domain dom created from dom.xml

#virsh list --all
 Id Name                 State
  6 dom                  paused

Is that means the bug has been fixed?
Comment 21 Eric Blake 2010-07-23 07:59:06 EDT
Yes, it's fixed.  Without the patch, virsh would have choked on --paused.
Comment 22 weizhang 2010-07-25 21:11:36 EDT
According to comment 20 and 21, this bug can be verified.
Comment 23 Nan Zhang 2010-09-07 03:38:14 EDT
Verified with libvirt-0.8.1-27.el6.x86_64.

# virsh create rhel6.xml --paused
Domain rhel6 created from rhel6.xml

# virsh list --all
 Id Name                 State
  6 rhel6                paused
  - rhel6-rc             shut off
  - winxp                shut off
Comment 24 releng-rhel@redhat.com 2010-11-11 09:48:07 EST
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.