From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giovanni Biscuolo Subject: "guix system vm" to libvirt XML domain Date: Thu, 24 Jan 2019 19:18:52 +0100 Message-ID: <87o985c41f.fsf@roquette.mug.biscuolo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:54519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmjb6-0002pL-2F for help-guix@gnu.org; Thu, 24 Jan 2019 13:19:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmjb0-0008K8-1C for help-guix@gnu.org; Thu, 24 Jan 2019 13:19:23 -0500 Received: from ns13.heimat.it ([46.4.214.66]:40474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmjax-0008GQ-UL for help-guix@gnu.org; Thu, 24 Jan 2019 13:19:20 -0500 Received: from localhost (ip6-localhost [127.0.0.1]) by ns13.heimat.it (Postfix) with ESMTP id ADBA5300F5C for ; Thu, 24 Jan 2019 18:19:15 +0000 (UTC) Received: from ns13.heimat.it ([127.0.0.1]) by localhost (ns13.heimat.it [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CEf5ujLKnogr for ; Thu, 24 Jan 2019 18:18:55 +0000 (UTC) Received: from bourrache.mug.xelera.it (unknown [93.56.161.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ns13.heimat.it (Postfix) with ESMTPSA id 1A1223000D3 for ; Thu, 24 Jan 2019 18:18:55 +0000 (UTC) Received: from roquette.mug.biscuolo.net (roquette.mug.biscuolo.net [10.38.2.14]) by bourrache.mug.xelera.it (Postfix) with SMTP id 40FF9300056 for ; Thu, 24 Jan 2019 19:18:54 +0100 (CET) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: help-guix@gnu.org --=-=-= Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --==-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi! I'm using guix on a foreign distro (Debian 9) and I'm already using libvirtd to manage some KVM guests; I'd like to also manage "guix system vm" generated ones using libvirt it would be great to be able to automatically manage the (re)definition of VMs (and containers?) on - possibly remote - libvirtd servers using a distributedVM.scm config :-): WDYT? anyway... as for now it must be "manually" managed and this is what I'm doing: it fails at the end, what am I doing wrong? is there a better way to do it? 1. I save the "command line" from the script generated by "guix system vm" (except the last "@") calling this "container.minimal.args.orig =2D-8<---------------cut here---------------start------------->8--- /gnu/store/4pnx934k40wni57r5swj2kr29l1j549f-qemu-3.1.0/bin/qemu-system-x86_= 64 -kernel /gnu/store/y5aiijqiqna1y8ypn6c0jp367813xxnc-linux-libre-4.20.3/b= zImage -initrd /gnu/store/9xgqs9zf51i9binqjl5hgl8gl7ql40hc-system/initrd -a= ppend "--root=3D/dev/vda1 --system=3D/gnu/store/9xgqs9zf51i9binqjl5hgl8gl7q= l40hc-system --load=3D/gnu/store/9xgqs9zf51i9binqjl5hgl8gl7ql40hc-system/bo= ot" -enable-kvm -no-reboot -net nic,model=3Dvirtio -object rng-random,filen= ame=3D/dev/urandom,id=3Dguixsd-vm-rng -device virtio-rng-pci,rng=3Dguixsd-v= m-rng -virtfs local,path=3D"/gnu/store",security_model=3Dnone,mount_tag=3D"= TAGjoptajej2oynju6yvboauz7pl6uj" -vga std -drive file=3D/gnu/store/4mz1qqv7= h5g5885q1aq0izlmy01knf1g-qemu-image,if=3Dvirtio,cache=3Dwriteback,werror=3D= report,readonly -m 256 =2D-8<---------------cut here---------------end--------------->8--- 2. try to convert it to libvirt XML domain definition =2D-8<---------------cut here---------------start------------->8--- $ virsh --connect qemu:///system domxml-from-native qemu-argv container-min= imal.args.orig=20 error: internal error: malformed keyword arguments in 'file=3D/gnu/store/4m= z1qqv7h5g5885q1aq0izlmy01knf1g-qemu-image,if=3Dvirtio,cache=3Dwriteback,wer= ror=3Dreport,readonly' =2D-8<---------------cut here---------------end--------------->8--- 3. remove the "readonly" keyword from the last "-drive" arg, calling this "container.minimal.args" (that *must* be then manually added to the XML definition) =2D-8<---------------cut here---------------start------------->8--- /gnu/store/4pnx934k40wni57r5swj2kr29l1j549f-qemu-3.1.0/bin/qemu-system-x86_= 64 -kernel /gnu/store/y5aiijqiqna1y8ypn6c0jp367813xxnc-linux-libre-4.20.3/b= zImage -initrd /gnu/store/9xgqs9zf51i9binqjl5hgl8gl7ql40hc-system/initrd -a= ppend "--root=3D/dev/vda1 --system=3D/gnu/store/9xgqs9zf51i9binqjl5hgl8gl7q= l40hc-system --load=3D/gnu/store/9xgqs9zf51i9binqjl5hgl8gl7ql40hc-system/bo= ot" -enable-kvm -no-reboot -net nic,model=3Dvirtio -object rng-random,filen= ame=3D/dev/urandom,id=3Dguixsd-vm-rng -device virtio-rng-pci,rng=3Dguixsd-v= m-rng -virtfs local,path=3D"/gnu/store",security_model=3Dnone,mount_tag=3D"= TAGjoptajej2oynju6yvboauz7pl6uj" -vga std -drive file=3D/gnu/store/4mz1qqv7= h5g5885q1aq0izlmy01knf1g-qemu-image,if=3Dvirtio,cache=3Dwriteback,werror=3D= report -m 256 =2D-8<---------------cut here---------------end--------------->8--- 4. converting the file above =2D-8<---------------cut here---------------start------------->8--- $ virsh --connect qemu:///system domxml-from-native qemu-argv container-min= imal.args unnamed 894f668e-32a5-4331-9d30-8604b89ae359 262144 262144 1 hvm /gnu/store/y5aiijqiqna1y8ypn6c0jp367813xxnc-linux-libre-4.20.3/= bzImage /gnu/store/9xgqs9zf51i9binqjl5hgl8gl7ql40hc-system/initrd --root=3D/dev/vda1 --system=3D/gnu/store/9xgqs9zf51i9binqjl5hg= l8gl7ql40hc-system --load=3D/gnu/store/9xgqs9zf51i9binqjl5hgl8gl7ql40hc-sys= tem/boot destroy destroy destroy /gnu/store/4pnx934k40wni57r5swj2kr29l1j549f-qemu-3.1.0/bin/qe= mu-system-x86_64