Bug 1060557
| Summary: | VMs with names longer than 48 characters can be created but not started | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Jake Hunsaker <jhunsaker> |
| Component: | libvirt | Assignee: | Jiri Denemark <jdenemar> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 6.5 | CC: | audgiri, berrange, dyuan, iheim, jdenemar, jhunsaker, lcui, lpeer, lsu, mchappel, michal.skrivanek, mjenner, mzhan, ofrenkel, oourfali, rbalakri, Rhev-m-bugs, teigland, tlavigne, vfeenstr, yeylon |
| Target Milestone: | rc | Keywords: | ZStream |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | virt | ||
| Fixed In Version: | libvirt-0.10.2-30.el6 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-10-14 04:20:10 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: | |||
| Bug Depends On: | |||
| Bug Blocks: | 1070905 | ||
|
Description
Jake Hunsaker
2014-02-02 15:22:58 UTC
This restriction is due to the sanlock lock driver plugin. Libvirt has to provide the guest name to sanlock, and this is done via a 'struct sanlk_options' table which has 'char owner_name[SANLK_NAME_LEN]' where #define SANLK_NAME_LEN 48 Thus libvirt currently raises an error if the name is longer than what sanlock will accept here. If sanlock would be functionally happy with us truncating this name string, then we could do that instead. As Daniel already mentioned, the limit comes from sanlock and it was there since sanlock is supported by libvirt. If you see domains failing to start after upgrade, it means upgraded vdsm must be telling libvirt to use sanlock when older vdsm did not do so. To make sure this is the case, could you provide vdsm and libvirtd logs with the failed attempt to start a domain with a long name? David, what is the owner_name used for? In other words, do two different owners need to use distinct owner_name or can libvirt just shrink domain name to the first 48 characters, which could result in two different owners ending up with the same owner_name? Setting sanlk_options or the owner_name is unnecessary, and has very little to no benefit. If you do provide something in owner_name, it can be anything, sanlock doesn't care or use it. If you run the command "sanlock status", the output will display a list of clients connected to the sanlock daemon. This client list is displayed as "pid owner_name" if the client has provided an owner_name via sanlk_options. This debugging output is the only usage of owner_name, so its only benefit is to potentially provide a more human friendly output for debugging purposes. Ah, perfect, so we can just take the first 48 characters to get rid of this particular limit. This is now fixed upstream by commit v1.2.2-rc2-16-g8f10c1e:
commit 8f10c1e77fdbc165ff6d6b4a5a42ab7b31e30819
Author: Jiri Denemark <jdenemar>
Date: Thu Feb 27 09:32:41 2014 +0100
sanlock: Truncate domain names longer than SANLK_NAME_LEN
Libvirt uses a domain name to fill in owner_name in sanlock_options in
virLockManagerSanlockAcquire. Unfortunately, owner_name is limited to
SANLK_NAME_LEN characters (including trailing '\0'), which means domains
with longer names fail to start when sanlock is enabled. However, we can
truncate the name when setting owner_name as explained by sanlock's
author:
Setting sanlk_options or the owner_name is unnecessary, and has very
little to no benefit. If you do provide something in owner_name, it can
be anything, sanlock doesn't care or use it.
If you run the command "sanlock status", the output will display a list
of clients connected to the sanlock daemon. This client list is
displayed as "pid owner_name" if the client has provided an owner_name
via sanlk_options. This debugging output is the only usage of
owner_name, so its only benefit is to potentially provide a more human
friendly output for debugging purposes.
I can reproduce this issue with: RHEVM 3.3.1-0.48.el6ev libvirt-0.10.2-29.el6_5.4.x86_64 Create a vm with name "mhuizer_9123456789212345678931234567894123456789512111" which name length is longer than 48. start the vm, from the event console, error message will pop up: "VM mhuizer_9123456789212345678931234567894123456789512111 is down. Exit message: internal error internal error Domain name 'mhuizer_9123456789212345678931234567894123456789512111' exceeded 48 characters." Test with
libvirt-0.10.2-32.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.424.el6.x86_64
sanlock-2.8-1.el6.x86_64
1.Pre-configuration
#tail -1 /etc/lib/libvirt/qemu.conf
lock_manager = "sanlock"
#tail -6 /etc/lib/libvirt/qemu-sanlock.conf
auto_disk_leases = 1
disk_lease_dir = "/var/lib/libvirt/sanlock"
host_id = 1
require_lease_for_disks = 1
user = "sanlock"
group = "sanlock"
#setsebool virt_use_sanlock 1
2.Service start
#service wdmd start
#service sanlock start
#service libvirtd restart
3.Guest preparation , name includes 50 characters
#virsh dumpxml $name
<domain type='kvm'>
<name>12345678901234567890123456789012345678901234567890</name>
<uuid>27109d30-1f0e-49ef-03fe-753d085df7c8</uuid>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='rhel6.5.0'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw' cache='none'/>
<source file='/var/lib/libvirt/images/test.img'/>
<target dev='hda' bus='ide'/>
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
</disk>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='network'>
<mac address='52:54:00:4b:ca:53'/>
<source network='default'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</memballoon>
</devices>
</domain>
4.
#virsh start $name
Domain 12345678901234567890123456789012345678901234567890 started
# sanlock client status
daemon fa6d6994-7c66-4ec5-869b-c45f3a6220a8.intel-e312
p -1 helper
p -1 listener
p 5164 12345678901234567890123456789012345678901234567
p -1 status
s __LIBVIRT__DISKS__:1:/var/lib/libvirt/sanlock/__LIBVIRT__DISKS__:0
r __LIBVIRT__DISKS__:f30a79d7d4b9c375cf1b1a5feb8e8e1f:/var/lib/libvirt/sanlock/f30a79d7d4b9c375cf1b1a5feb8e8e1f:0:5 p 5164
From sanlock to view , the name is auto cut into 47 characters by libvirt
5.In the previous libvirt version , i.e 29 , try to start the guest will trigger this error:
#virsh start 12345678901234567890123456789012345678901234567890
error: Failed to start domain 12345678901234567890123456789012345678901234567890
error: internal error internal error Domain name '12345678901234567890123456789012345678901234567890' exceeded 48 characters
According above all , set VERFIED
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2014-1374.html |