Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 904951

Summary: [LXC] virsh start is too slow
Product: Red Hat Enterprise Linux 6 Reporter: Alex Jia <ajia>
Component: libvirtAssignee: Daniel Berrangé <berrange>
Status: CLOSED WORKSFORME QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: high    
Version: 6.4CC: acathrow, ajia, berrange, cwei, dallan, dyuan, mzhan, zhwang
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-08-02 14:12:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alex Jia 2013-01-28 09:07:25 UTC
Description of problem:
I originally think virsh start is hang, but I found I had to wait like for 1 minutes to successfully boot a lxc guest.

Version-Release number of selected component (if applicable):
[root@dell-op790-03 ]# rpm -q libvirt qemu-kvm-rhev kernel
libvirt-0.10.2-17.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.355.el6.x86_64
kernel-2.6.32-356.el6.x86_64


How reproducible:
always

Steps to Reproduce:
1. # virsh -c lxc:// list --all
 Id    Name                           State
----------------------------------------------------
 -     toy                            shut off

2. # virsh -c lxc:// dumpxml toy
<domain type='lxc'>
  <name>toy</name>
  <uuid>db24dba4-de16-4232-805a-f9c429bc3b3b</uuid>
  <memory unit='KiB'>500000</memory>
  <currentMemory unit='KiB'>500000</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <os>
    <type arch='x86_64'>exe</type>
    <init>/bin/sh</init>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/libvirt_lxc</emulator>
    <console type='pty'>
      <target type='lxc' port='0'/>
    </console>
  </devices>
</domain>

3. # time virsh -c lxc:// start toy
Domain toy started


real	1m15.378s
user	0m0.007s
sys	0m0.007s


  
Actual results:

real	1m15.378s
user	0m0.007s
sys	0m0.007s

Expected results:

To improve a guest booting time.

Additional info:

# lscgroup
cpuset:/
cpuset:/libvirt
cpuset:/libvirt/lxc
cpuset:/libvirt/qemu
cpu:/
cpu:/libvirt
cpu:/libvirt/lxc
cpu:/libvirt/qemu
cpuacct:/
cpuacct:/libvirt
cpuacct:/libvirt/lxc
cpuacct:/libvirt/qemu
memory:/
memory:/libvirt
memory:/libvirt/lxc
memory:/libvirt/qemu
devices:/
devices:/libvirt
devices:/libvirt/lxc
devices:/libvirt/qemu
freezer:/
freezer:/libvirt
freezer:/libvirt/lxc
freezer:/libvirt/qemu
net_cls:/
blkio:/
blkio:/libvirt
blkio:/libvirt/lxc
blkio:/libvirt/qemu

Comment 2 Daniel Berrangé 2013-08-02 12:42:00 UTC
Do you still see this problem. I've never seen any 1 minute delay in starting LXC guests in any version of libvirt & can't reproduce this.

Comment 3 Alex Jia 2013-08-02 14:12:41 UTC
(In reply to Daniel Berrange from comment #2)
> Do you still see this problem. I've never seen any 1 minute delay in
> starting LXC guests in any version of libvirt & can't reproduce this.

Daniel, not sure a real test environment, but I indeed met this ago, for now, it works well on libvirt-1.1.1-1.el7.x86_64, so close the bug as WORKSFORME.

]# for i in {1..5}; do time virsh -c lxc:// start toy && virsh -c lxc:// destroy toy;done
Domain toy started


real    0m0.211s
user    0m0.011s
sys     0m0.010s
Domain toy destroyed

Domain toy started


real    0m0.076s
user    0m0.008s
sys     0m0.003s
Domain toy destroyed

Domain toy started


real    0m0.073s
user    0m0.011s
sys     0m0.001s
Domain toy destroyed

Domain toy started


real    0m0.069s
user    0m0.007s
sys     0m0.003s
Domain toy destroyed

Domain toy started


real    0m0.068s
user    0m0.009s
sys     0m0.002s
Domain toy destroyed

Comment 4 zhenfeng wang 2013-08-19 07:36:33 UTC
Hi Daniel,
I just met this issue on rhel6.5 with the latest libvirt packet. However, since there was a kernel bug 982886 which make the guest fail to start in rhel6.5, so i try it with the 6.4.z's kernel packet. Thus, I'm not sure whether my testing is appropriate or not, and do we have necessary to reopen this bug ? thanks

Version-Release number of selected component (if applicable):
libvirt-0.10.2-22.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.382.el6.x86_64
kernel-2.6.32-358.12.1.el6.00754306.0.x86_64
selinux-policy-3.7.19-211.el6.noarch

How reproducible:
100%

Steps to Reproduce:
1.# getenforce
Enforcing

2. cat toy.xml
<domain type='lxc'>
  <name>toy</name>
  <uuid>386f5b25-43ee-9d62-4ce2-62c3809e47c1</uuid>
  <memory unit='KiB'>500000</memory>
  <currentMemory unit='KiB'>412300</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64'>exe</type>
    <init>/bin/sh</init>
  </os>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/libvirt_lxc</emulator>
    <console type='pty'>
      <target type='lxc' port='0'/>
    </console>
  </devices>
</domain>

3.define and start toy, It took more than 1 minutes to start
#virsh -c lxc:/// define toy.xml
#virsh  -c lxc:/// start toy


4.it will very fast to destroy the guest
# virsh -c lxc:/// destroy toy
Domain toy destroyed

5.The guest will start very fast while disable the selinux
#setenforce 0
#virsh -c lxc:/// start toy

Actual results:
as steps

Expected results:
shouldn't take a long time to start the lxc guest