Description of problem: Creating a libvirt-lxc domain with virDomainCreateXML fails with EINVAL if the name is longer 60 characters. error: Failed to create domain from /root/libvirt-lxc-config.xml error: internal error: guest failed to start: Invalid argument 2013-11-21 23:58:27.520+0000: starting up PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin LIBVIRT_DEBUG=3 LIBVIRT_LOG_OUTPUTS=3:stderr /usr/libexec/libvirt_lxc --name 1234567890123456789012345678901234567890123456789012345678901 --console 22 --security=selinux --handshake 25 --background --veth vnet1 2013-11-21 23:58:28.067+0000: 3195: info : libvirt version: 1.1.4, package: 2.fc21 (Fedora Project, 2013-11-12-14:52:51, buildvm-24.phx2.fedoraproject.org) 2013-11-21 23:58:28.067+0000: 3195: error : virDBusCallMethod:1205 : Invalid argument Invalid argument This worked fine in F19. Version-Release number of selected component (if applicable): Fedora Rawhide libvirt-daemon-1.1.4-2.fc21.x86_64 dbus-1.6.18-1.fc21.x86_64 systemd-208-6.fc21.x86_64 How reproducible: Create a libvirt-lxc domain with a name of 61 characters. Steps to Reproduce: [root@rawhide ~]# cat libvirt-lxc-config.xml <domain type='lxc'> <name>1234567890123456789012345678901234567890123456789012345678901</name> <memory>500000</memory> <os> <type>exe</type> <init>/bin/sh</init> </os> <vcpu>1</vcpu> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <clock offset='utc'/> <devices> <emulator>/usr/libexec/libvirt_lxc</emulator> <interface type='network'> <source network='default'/> </interface> <console type='pty'/> </devices> </domain> [root@rawhide ~]# virsh -c lxc:/// create libvirt-lxc-config.xml error: Failed to create domain from libvirt-lxc-config.xml error: internal error: guest failed to start: Invalid argument Actual results: Domain creation failure Expected results: Domain creation success Additional info:
Lennart, does either systemd impose some kind of length limit on scope names ? The "Invalid argument" error we're getting here comes from the CreateMachine dbus api call we're making to systemd-machined.
Still relevant with latest f20, and libvirt git. (In reply to Daniel Berrange from comment #1) > Lennart, does either systemd impose some kind of length limit on scope names > ? The "Invalid argument" error we're getting here comes from the > CreateMachine dbus api call we're making to systemd-machined. Setting needinfo on systemd-maint. systemd devs, please see the above question
Yes, we do enforce limits in syntax and length for unit names (256 chars, but you have to subtract the ".scope" suffix from that. Also if you need weird chars escaping costs three chars per original char extra. That said, we make much stronger requirements on machine names currently, and thats what is going to bite you more: 64 ch max. That said, thinking about it we should probably change this to match the retrictions usually made on hostnames...
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle. Changing version to '22'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22
This should be fixed as of libvirt 1.3.4, there were a bunch of patches in this area recently