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 1060557 - VMs with names longer than 48 characters can be created but not started
Summary: VMs with names longer than 48 characters can be created but not started
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.5
Hardware: All
OS: All
high
high
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Virtualization Bugs
URL:
Whiteboard: virt
Depends On:
Blocks: 1070905
TreeView+ depends on / blocked
 
Reported: 2014-02-02 15:22 UTC by Jake Hunsaker
Modified: 2019-10-10 09:14 UTC (History)
21 users (show)

Fixed In Version: libvirt-0.10.2-30.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-10-14 04:20:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1374 0 normal SHIPPED_LIVE libvirt bug fix and enhancement update 2014-10-14 08:11:54 UTC

Description Jake Hunsaker 2014-02-02 15:22:58 UTC
Description of problem:

In 3.3.0 a VM with a name longer than 48 characters can be created, but not started.

Version-Release number of selected component (if applicable):

rhevm-3.3.0

How reproducible:

Always

Steps to Reproduce:
1. Create VM is a name longer than 48 characters
2. Try to start the VM
3.

Actual results:

VM will not start

Example error:

2014-Jan-31, 13:26
VM mhuizer_9123456789212345678931234567894123456789512345 is down. Exit message: internal error internal error Domain name 'mhuizer_9123456789212345678931234567894123456789512345' exceeded 48 characters.

Expected results:

Either the VM should start normally, as they do in previous versions, or the VM should not be able to be created with a name longer than 48 characters.

Additional info:

Comment 9 Daniel Berrangé 2014-02-17 11:02:19 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.

Comment 14 Jiri Denemark 2014-02-25 10:35:13 UTC
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?

Comment 15 Jiri Denemark 2014-02-25 10:39:58 UTC
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?

Comment 22 David Teigland 2014-02-25 16:05:27 UTC
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.

Comment 23 Jiri Denemark 2014-02-25 16:10:47 UTC
Ah, perfect, so we can just take the first 48 characters to get rid of this particular limit.

Comment 25 Jiri Denemark 2014-02-27 11:07:32 UTC
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.

Comment 28 Cui Lei 2014-02-28 07:48:58 UTC
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."

Comment 30 Luwen Su 2014-04-16 06:13:09 UTC
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

Comment 32 errata-xmlrpc 2014-10-14 04:20:10 UTC
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


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