cockpit-project / cockpit

Cockpit is a web-based graphical interface for servers.
http://www.cockpit-project.org/
GNU Lesser General Public License v2.1
10.99k stars 1.1k forks source link

machines: Can't create virtual machine from ISO url (server does not support range option) #12090

Closed oleksandrborniak closed 5 years ago

oleksandrborniak commented 5 years ago

Cockpit version: cockpit-196 OS: fedora 30 Page: "Machines" Problem: can't create virtual machine

Screen Shot 2019-06-18 at 15 02 00 Screen Shot 2019-06-18 at 14 59 16
[root@fc tools]# ./execsnoop --max-args 150
PCOMM            PID    PPID   RET ARGS
sh               8415   7864     0 /bin/sh -c #!/bin/sh\n\nset -u -o noglob\n\nCONNECTION_URI="qemu:///$1" # example: qemu:///system\nVM_NAME="$2"\nSOURCE_TYPE="$3"\nSOURCE="$4"\nOS= -- system Fedora29Test url http://download.fedoraproject.org/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso fedora29 4096 1 path=/var/lib/libvirt/images/Fedora29Test.qcow2,device=disk,bus=virtio,readonly=off,shareable=off,driver_name=qemu,driver_type=q type=spice,listen=127.0.0.1\ntype=vnc,listen=127.0.0.1,port=-1\n\n
mktemp           8418   8415     0 /usr/bin/mktemp
virsh            8419   8415     0 /usr/bin/virsh -c qemu:///system -q destroy Fedora29Test
virsh            8421   8415     0 /usr/bin/virsh -c qemu:///system -q dumpxml Fedora29Test
virsh            8423   8415     0 /usr/bin/virsh -c qemu:///system -q undefine Fedora29Test --managed-save
virt-install     8425   8415     0 /usr/bin/virt-install --connect qemu:///system --name Fedora29Test --os-variant fedora29 --memory 4096 --vcpus 1 --quiet --wait -1 --noautoconsole --noreboot --check path_in_use=off --disk path=/var/lib/libvirt/images/Fedora29Test.qcow2,device=disk,bus=virtio,readonly=off,shareable=off,driver_name=qemu,driver_type=q --cdrom http://download.fedoraproject.org/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso --graphics type=spice,listen=127.0.0.1 --graphics type=vnc,listen=127.0.0.1,port=-1
virt-install     8425   8415     0 /usr/share/virt-manager/virt-install --connect qemu:///system --name Fedora29Test --os-variant fedora29 --memory 4096 --vcpus 1 --quiet --wait -1 --noautoconsole --noreboot --check path_in_use=off --disk path=/var/lib/libvirt/images/Fedora29Test.qcow2,device=disk,bus=virtio,readonly=off,shareable=off,driver_name=qemu,driver_type=q --cdrom http://download.fedoraproject.org/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso --graphics type=spice,listen=127.0.0.1 --graphics type=vnc,listen=127.0.0.1,port=-1
systemd-sysctl   8432   8431     0 /usr/lib/systemd/systemd-sysctl --prefix=/net/ipv4/conf/vnet0 --prefix=/net/ipv4/neigh/vnet0 --prefix=/net/ipv6/conf/vnet0 --prefix=/net/ipv6/neigh/vnet0
nm-dispatcher    8436   1        0 /usr/libexec/nm-dispatcher
qemu-system-x86  8434   1        0 /usr/bin/qemu-system-x86_64 -name guest=Fedora29Test,debug-threads=on -S -object secret,id=masterKey0,format=raw,file=/var/lib/libvirt/qemu/domain-3-Fedora29Test/master-key.aes -machine pc-q35-3.1,accel=kvm,usb=off,vmport=off,dump-guest-core=off -cpu Nehalem,vme=on,ss=on,vmx=on,x2apic=on,tsc-deadline=on,hypervisor=on,arat=on,tsc_adjust=on,umip=on,rdtscp=on -m 4096 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 8e9a7f98-3990-4b80-8fea-bc5d5153053c -no-user-config -nodefaults -chardev socket,id=charmonitor,fd=31,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=delay -no-hpet -no-reboot -global ICH9-LPC.disable_s3=1 -global ICH9-LPC.disable_s4=1 -boot strict=on -device pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x2 -device pcie-root-port,port=0x11,chassis=2,id=pci.2,bus=pcie.0,addr=0x2.0x1 -device pcie-root-port,port=0x12,chassis=3,id=pci.3,bus=pcie.0,addr=0x2.0x2 -device pcie-root-port,port=0x13,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x3 -device pcie-root-port,port=0x14,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x4 -device pcie-root-port,port=0x15,chassis=6,id=pci.6,bus=pcie.0,addr=0x2.0x5 -device pcie-root-port,port=0x16,chassis=7,id=pci.7,bus=pcie.0,addr=0x2.0x6 -device qemu-xhci,p2=15,p3=15,id=usb,bus=pci.2,addr=0x0 -device virtio-serial-pci,id=virtio-serial0,bus=pci.3,addr=0x0 -drive file=/var/lib/libvirt/images/Fedora29Test.qcow2,format=qcow2,if=none,id=drive-virtio-disk0 -device virtio-blk-pci,scsi=off,bus=pci.4,addr=0x0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=2 -drive file=http://download.fedoraproject.org:80/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso -device ide-cd,bus=ide.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=1 -netdev tap,fd=33,id=hostnet0,vhost=on,vhostfd=34 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:d7:60:5d,bus=pci.1,addr=0x0 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev socket,id=charchannel0,fd=35,server,nowait -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=org.qemu.guest_agent.0 -chardev spicevmc,id=charchannel1,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=charchannel1,id=channel1,name=com.redhat.spice.0 -device usb-tablet,id=input0,bus=usb.0,port=1 -spice port=5900,addr=127.0.0.1,disable-ticketing,image-compression=off,seamless-migration=on -vnc 127.0.0.1:1 -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pcie.0,addr=0x1 -device ich9-intel-hda,id=sound0,bus=pcie.0,addr=0x1b -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -chardev spicevmc,id=charredir0,name=usbredir -device usb-redir,chardev=charredir0,id=redir0,bus=usb.0,port=2 -chardev spicevmc,id=charredir1,name=usbredir -device usb-redir,chardev=charredir1,id=redir1,bus=usb.0,port=3 -device virtio-balloon-pci,id=balloon0,bus=pci.5,addr=0x0 -object rng-random,id=objrng0,filename=/dev/urandom -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pci.6,addr=0x0 -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on
[root@fc tools]# journalctl -b -u libvirtd -p err --no-pager
-- Logs begin at Tue 2019-05-28 22:19:14 EEST, end at Tue 2019-06-18 15:14:38 EEST. --
Jun 18 14:58:19 fc.my-clouds.net libvirtd[996]: Unable to read from monitor: Connection reset by peer
Jun 18 14:58:19 fc.my-clouds.net libvirtd[996]: internal error: qemu unexpectedly closed the monitor: 2019-06-18T11:58:19.924092Z qemu-system-x86_64: -drive file=http://download.fedoraproject.org:80/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso,format=raw,if=none,id=drive-sata0-0-0,readonly=on: Unknown protocol 'http'
Jun 18 14:58:19 fc.my-clouds.net libvirtd[996]: internal error: process exited while connecting to monitor: 2019-06-18T11:58:19.924092Z qemu-system-x86_64: -drive file=http://download.fedoraproject.org:80/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso,format=raw,if=none,id=drive-sata0-0-0,readonly=on: Unknown protocol 'http'
Jun 18 15:01:04 fc.my-clouds.net libvirtd[996]: unable to stat: /var/lib/libvirt/boot/virtinst-vmlinuz.o3rzfct4: No such file or directory
Jun 18 15:02:29 fc.my-clouds.net libvirtd[996]: Unable to read from monitor: Connection reset by peer
Jun 18 15:02:29 fc.my-clouds.net libvirtd[996]: internal error: qemu unexpectedly closed the monitor: 2019-06-18T12:02:29.830235Z qemu-system-x86_64: -drive file=http://download.fedoraproject.org:80/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso,format=raw,if=none,id=drive-sata0-0-0,readonly=on: Unknown protocol 'http'
Jun 18 15:02:29 fc.my-clouds.net libvirtd[996]: internal error: process exited while connecting to monitor: 2019-06-18T12:02:29.830235Z qemu-system-x86_64: -drive file=http://download.fedoraproject.org:80/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso,format=raw,if=none,id=drive-sata0-0-0,readonly=on: Unknown protocol 'http'
Jun 18 15:05:29 fc.my-clouds.net libvirtd[996]: Unable to read from monitor: Connection reset by peer
Jun 18 15:05:29 fc.my-clouds.net libvirtd[996]: internal error: qemu unexpectedly closed the monitor: 2019-06-18T12:05:29.524259Z qemu-system-x86_64: -drive file=http://download.fedoraproject.org:80/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso,format=raw,if=none,id=drive-sata0-0-0,readonly=on: Unknown protocol 'http'
Jun 18 15:05:29 fc.my-clouds.net libvirtd[996]: internal error: process exited while connecting to monitor: 2019-06-18T12:05:29.524259Z qemu-system-x86_64: -drive file=http://download.fedoraproject.org:80/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso,format=raw,if=none,id=drive-sata0-0-0,readonly=on: Unknown protocol 'http'
Jun 18 15:06:13 fc.my-clouds.net libvirtd[996]: unsupported configuration: unknown driver format value 'q'
[root@fc tools]#
marusak commented 5 years ago

It says unknown protocol 'http', somewhere back in my head I have information that only https is allowed. I think that @KKoukiou or @skobyda would know for sure.

oleksandrborniak commented 5 years ago

The same for "https".

Screen Shot 2019-06-20 at 10 57 43
oleksandrborniak commented 5 years ago
Jun 20 10:57:28 fc.my-clouds.net libvirtd[992]: libvirt version: 5.1.0, package: 8.fc30 (Fedora Project, 2019-05-31-15:59:20, )
Jun 20 10:57:28 fc.my-clouds.net libvirtd[992]: Unable to read from monitor: Connection reset by peer
Jun 20 10:57:28 fc.my-clouds.net libvirtd[992]: internal error: qemu unexpectedly closed the monitor: 2019-06-20T07:57:28.223455Z qemu-system-x86_64: -drive file=https://download.fedoraproject.org:443/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso,format=raw,if=none,id=drive-sata0-0-0,readonly=on: Unknown protocol 'https'
KKoukiou commented 5 years ago

@oleksandrborniak could you please trying out the CLI command to create a VM with the same parameters? Something like:

# virt-install \ 
  --name guest1-rhel7 \ 
  --memory 2048 \ 
  --vcpus 2 \ 
  --disk size=8 \ 
  --location http://example.com/path/to/os \ 
  --os-variant rhel7 

And of course replace with your iso link etc. Does it give you the same error?

oleksandrborniak commented 5 years ago

@KKoukiou It has been done. I can provide you with access to this test environment, if you wish.

[root@fc tools]# /usr/bin/virt-install --connect qemu:///system --name Fedora29Test --os-variant fedora29 --memory 4096 --vcpus 1  --wait -1 --noautoconsole --noreboot --check path_in_use=off --disk path=/var/lib/libvirt/images/Fedora29Test.qcow2,device=disk,bus=virtio,readonly=off,shareable=off,driver_name=qemu --cdrom https://download.fedoraproject.org/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso --graphics type=spice,listen=127.0.0.1 --graphics type=vnc,listen=127.0.0.1,port=-1

Starting install...
ERROR    internal error: process exited while connecting to monitor: 2019-06-20T09:53:43.346774Z qemu-system-x86_64: -drive file=https://download.fedoraproject.org:443/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso,format=raw,if=none,id=drive-sata0-0-0,readonly=on: Unknown protocol 'https'
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start Fedora29Test
otherwise, please restart your installation.
[root@fc tools]#
KKoukiou commented 5 years ago

So, what's happening here is that the server you are using (although it's the official one) does not support "range" option. The "range" option is necessary so that qemu can "seek" on the cd image. If you tried with newer virt-install you would get better error message suggesting so, see bellow:

$ sudo virt-install --connect qemu:///system --name test --memory 1000 --cdrom http://download.fedoraproject.org/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso --disk none
WARNING  No operating system detected, VM performance may suffer. Specify an OS with --os-variant for optimal results.

Starting install...
ERROR    internal error: process exited while connecting to monitor: 2019-06-20T11:53:26.696353Z qemu-system-x86_64: -drive file=http://download.fedoraproject.org:80/pub/fedora/linux/releases/29/Server/x86_64/iso/Fedora-Server-netinst-x86_64-29-1.2.iso,format=raw,if=none,id=drive-ide0-0-0,readonly=on: CURL: Error opening file: Server does not support 'range' (byte ranges).
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start test
otherwise, please restart your installation

So unfortunately your issue will not be resolved unless the fedora server gets configured to support "range" option. I will close this issue since this is not cockpit related, in fact it's not even virt-install related, the error comes from QEMU itself, which needs this option to be able to seek into the iso.

To get from cockpit UI successful installations either use a distro tree instead of iso media or find a server that supports the requirements or download the iso manually.