[libvirt-users] ceph rbd pool and libvirt manageability (virt-install)

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello everybody, I created a rbd pool and activated it, but I can't seem to create volumes in it with virsh or virt-install? # virsh pool-dumpxml myrbdpool <pool type='rbd'> <name>myrbdpool</name> <uuid>2d786f7a-2df3-4d79-ae60-1535bcf1c6b5</uuid> <capacity unit='bytes'>6997998301184</capacity> <allocation unit='bytes'>10309227031</allocation> <available unit='bytes'>6977204658176</available> <source> <host name='ceph01.powercraft.nl' port='6789'/> <host name='ceph02.powercraft.nl' port='6789'/> <host name='ceph03.powercraft.nl' port='6789'/> <name>libvirt-pool</name> <auth type='ceph' username='libvirt'> <secret uuid='029a334e-ed57-4293-bb99-ffafa8867122'/> </auth> </source> </pool> # virt-install --version 1.0.1 # virsh --version 1.2.9 I ended using virsh edit ceph-test.powercraft.nl and making creating the disk manually. <disk type='network' device='disk'> <auth username='libvirt'> <secret type='ceph' uuid='029a334e-ed57-4293-bb99-ffafa8867122'/> </auth> <source protocol='rbd' name='libvirt-pool/kvm01-storage'> <host name='ceph01.powercraft.nl' port='6789'/> <host name='ceph02.powercraft.nl' port='6789'/> <host name='ceph03.powercraft.nl' port='6789'/> </source> <target dev='vdc' bus='virtio'/> </disk> I use virt-install a lot to define, import and undefine domains, how can I use virt-install to manage my rdb disks? Kind regards, Jelle de Jong -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iJwEAQECAAYFAlV1xlQACgkQ1WclBW9j5HkbPQP+PjNrzvlqysslOp2Yk7wH4Mxy 2sh2dn96G0KOAHEeEn3BN6IWlnD1TADZbHdpTtMwkdv48Xwn0sP1s+3QDM4pb3gP n+z+dVxS8FouDIy/eiso3IBCj3g4TWbEX8ZHqs3jKqe0lZgAXBzB9xYSUowcEBrZ ddkPbr8p8ozWyOG+9V8= =lkK7 -----END PGP SIGNATURE-----

Hello everybody, virt-install --version 1.4.0 How do I create a ceph network disk with virt-install without having to edit it? <disk type='network' device='disk'> <driver name='qemu' type='raw'/> <auth username='libvirt'> <secret type='ceph' uuid='ec9be0c4-a60f-490e-af83-f0f27aaf48c9'/> </auth> <source protocol='rbd' name='libvirt-pool/zimbra-dev-disk'> <host name='ceph01.powercraft.nl' port='6789'/> <host name='ceph02.powercraft.nl' port='6789'/> <host name='ceph03.powercraft.nl' port='6789'/> </source> <target dev='vda' bus='virtio'/> </disk> How do I create an new vm with the -location and -x (kickstarter) but without booting it, because I need to edit the xml first before the first boot. Kind regards and best wishes, Jelle de Jong On 08/06/15 18:44, Jelle de Jong wrote:
Hello everybody,
I created a rbd pool and activated it, but I can't seem to create volumes in it with virsh or virt-install?
# virsh pool-dumpxml myrbdpool <pool type='rbd'> <name>myrbdpool</name> <uuid>2d786f7a-2df3-4d79-ae60-1535bcf1c6b5</uuid> <capacity unit='bytes'>6997998301184</capacity> <allocation unit='bytes'>10309227031</allocation> <available unit='bytes'>6977204658176</available> <source> <host name='ceph01.powercraft.nl' port='6789'/> <host name='ceph02.powercraft.nl' port='6789'/> <host name='ceph03.powercraft.nl' port='6789'/> <name>libvirt-pool</name> <auth type='ceph' username='libvirt'> <secret uuid='029a334e-ed57-4293-bb99-ffafa8867122'/> </auth> </source> </pool>
# virt-install --version 1.0.1
# virsh --version 1.2.9
I ended using virsh edit ceph-test.powercraft.nl and making creating the disk manually.
<disk type='network' device='disk'> <auth username='libvirt'> <secret type='ceph' uuid='029a334e-ed57-4293-bb99-ffafa8867122'/> </auth> <source protocol='rbd' name='libvirt-pool/kvm01-storage'> <host name='ceph01.powercraft.nl' port='6789'/> <host name='ceph02.powercraft.nl' port='6789'/> <host name='ceph03.powercraft.nl' port='6789'/> </source> <target dev='vdc' bus='virtio'/> </disk>
I use virt-install a lot to define, import and undefine domains, how can I use virt-install to manage my rdb disks?
Kind regards,
Jelle de Jong
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

On Mon, Aug 06, 2018 at 09:19:59PM +0200, Jelle de Jong wrote:
Hello everybody,
virt-install --version 1.4.0
How do I create a ceph network disk with virt-install without having to edit it?
<disk type='network' device='disk'> <driver name='qemu' type='raw'/> <auth username='libvirt'> <secret type='ceph' uuid='ec9be0c4-a60f-490e-af83-f0f27aaf48c9'/> </auth> <source protocol='rbd' name='libvirt-pool/zimbra-dev-disk'> <host name='ceph01.powercraft.nl' port='6789'/> <host name='ceph02.powercraft.nl' port='6789'/> <host name='ceph03.powercraft.nl' port='6789'/> </source> <target dev='vda' bus='virtio'/> </disk>
Hi, currently you are not able to create domain with that disk definition, with this command line: --disk source_protocol=rdb,source_name=libvirt-pool/zimbra-dev-disk,\ source_host_name=ceph01.powercraft.nl,source_host_port=6789,\ target=vda,bus=virtio,driver_type=raw you are able to create this definition: <disk type="network" device="disk"> <driver name="qemu" type="raw"/> <source protocol="rdb" name="libvirt-pool/zimbra-dev-disk"> <host name="ceph01.powercraft.nl" port="6789"/> </source> <target dev="vda" bus="virtio"/> </disk> Currently there is no way how to specify <auth> on the virt-install command line and also multiple source <host> elements.
How do I create an new vm with the -location and -x (kickstarter) but without booting it, because I need to edit the xml first before the first boot.
Look at options "--print-xml" and "--dry-run", it depends on your use-case. However, the installation process has usually two steps, you need to keep that in mind. By default virt-install creates two XML definitions, the first one is used to install the VM, after the installation is finished and the VM is rebooted virt-install will power off the VM instead of rebooting it and redefines the VM with second XML definition witch usually lacks the installation sources. If you need to update the XML before installation you need to handle the installation process by yourself. The --dry-run option can prevent storage creation if you don't need to create any storage before the actual installation. If the location points to some URL you will have to also manually download vmlinuz and initrd. So if the XML change can wait after the guest installation I would recommend doing that but if you need the change to XML it would be good idea to create Feature request to add that functionality into virt-install.
Kind regards and best wishes,
Jelle de Jong
On 08/06/15 18:44, Jelle de Jong wrote:
Hello everybody,
I created a rbd pool and activated it, but I can't seem to create volumes in it with virsh or virt-install?
# virsh pool-dumpxml myrbdpool <pool type='rbd'> <name>myrbdpool</name> <uuid>2d786f7a-2df3-4d79-ae60-1535bcf1c6b5</uuid> <capacity unit='bytes'>6997998301184</capacity> <allocation unit='bytes'>10309227031</allocation> <available unit='bytes'>6977204658176</available> <source> <host name='ceph01.powercraft.nl' port='6789'/> <host name='ceph02.powercraft.nl' port='6789'/> <host name='ceph03.powercraft.nl' port='6789'/> <name>libvirt-pool</name> <auth type='ceph' username='libvirt'> <secret uuid='029a334e-ed57-4293-bb99-ffafa8867122'/> </auth> </source> </pool>
# virt-install --version 1.0.1
# virsh --version 1.2.9
I ended using virsh edit ceph-test.powercraft.nl and making creating the disk manually.
<disk type='network' device='disk'> <auth username='libvirt'> <secret type='ceph' uuid='029a334e-ed57-4293-bb99-ffafa8867122'/> </auth> <source protocol='rbd' name='libvirt-pool/kvm01-storage'> <host name='ceph01.powercraft.nl' port='6789'/> <host name='ceph02.powercraft.nl' port='6789'/> <host name='ceph03.powercraft.nl' port='6789'/> </source> <target dev='vdc' bus='virtio'/> </disk>
I use virt-install a lot to define, import and undefine domains, how can I use virt-install to manage my rdb disks?
You cannot use virt-install to manage any disks, it is used only to create domain XML and install the VM. Virsh is a command line tool for libvirt and there you can manage disks, however for ceph volume creation is not currently implemented so you need to create them manually. Pavel
Kind regards,
Jelle de Jong
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users

I am having a hard time with this. virt-install \ --connect qemu:///system \ --hvm \ --virt-type kvm \ --network=default,model=virtio \ --noautoconsole \ --name zimbra-dev.powercraft.nl \ --ram 6144 \ --vcpus=4\ --vnc \ --os-type linux \ --os-variant rhel6 \ --nodisks \ --noreboot \ --print-step all \ --dry-run \ --location http://ftp.tudelft.nl/centos.org/7/os/x86_64/ \ -x "ks=https://raw.githubusercontent.com/Zimbra-Community/pgp-zimlet/stable/kvm/cen..." This will output an xml with multiple stages/steps. I can manually add the following to the steps with the following: <disk type='network' device='disk'> <driver name='qemu' type='raw'/> <auth username='libvirt'> <secret type='ceph' uuid='ec9be0c4-a60f-490e-af83-f0f27aaf48c9'/> </auth> <source protocol='rbd' name='libvirt-pool/zimbra-dev-disk'> <host name='ceph01.powercraft.nl' port='6789'/> <host name='ceph02.powercraft.nl' port='6789'/> <host name='ceph03.powercraft.nl' port='6789'/> </source> <target dev='vda' bus='virtio'/> </disk> However how do I import these xml steps so they are being executed. I tried to use: virsh define zimbra-dev.powercraft.nl.xml and keeping only the first domain definition, but booting does not work, since the boot files are not downloaded by virt-install first. Does somebody know a workaround. And for long term can I pay somebody a small bounty to add this functionality to virt-install. Ceph support would be appreciated... Would be nice to hear how other users use ceph with virt-install? Kind regards, Jelle de Jong On 07/08/18 12:47, Pavel Hrdina wrote:
On Mon, Aug 06, 2018 at 09:19:59PM +0200, Jelle de Jong wrote:
Hello everybody,
virt-install --version 1.4.0
How do I create a ceph network disk with virt-install without having to edit it?
<disk type='network' device='disk'> <driver name='qemu' type='raw'/> <auth username='libvirt'> <secret type='ceph' uuid='ec9be0c4-a60f-490e-af83-f0f27aaf48c9'/> </auth> <source protocol='rbd' name='libvirt-pool/zimbra-dev-disk'> <host name='ceph01.powercraft.nl' port='6789'/> <host name='ceph02.powercraft.nl' port='6789'/> <host name='ceph03.powercraft.nl' port='6789'/> </source> <target dev='vda' bus='virtio'/> </disk>
Hi, currently you are not able to create domain with that disk definition, with this command line:
--disk source_protocol=rdb,source_name=libvirt-pool/zimbra-dev-disk,\ source_host_name=ceph01.powercraft.nl,source_host_port=6789,\ target=vda,bus=virtio,driver_type=raw
you are able to create this definition:
<disk type="network" device="disk"> <driver name="qemu" type="raw"/> <source protocol="rdb" name="libvirt-pool/zimbra-dev-disk"> <host name="ceph01.powercraft.nl" port="6789"/> </source> <target dev="vda" bus="virtio"/> </disk>
Currently there is no way how to specify <auth> on the virt-install command line and also multiple source <host> elements.
How do I create an new vm with the -location and -x (kickstarter) but without booting it, because I need to edit the xml first before the first boot.
Look at options "--print-xml" and "--dry-run", it depends on your use-case. However, the installation process has usually two steps, you need to keep that in mind.
By default virt-install creates two XML definitions, the first one is used to install the VM, after the installation is finished and the VM is rebooted virt-install will power off the VM instead of rebooting it and redefines the VM with second XML definition witch usually lacks the installation sources.
If you need to update the XML before installation you need to handle the installation process by yourself. The --dry-run option can prevent storage creation if you don't need to create any storage before the actual installation. If the location points to some URL you will have to also manually download vmlinuz and initrd.
So if the XML change can wait after the guest installation I would recommend doing that but if you need the change to XML it would be good idea to create Feature request to add that functionality into virt-install.
Kind regards and best wishes,
Jelle de Jong
On 08/06/15 18:44, Jelle de Jong wrote:
Hello everybody,
I created a rbd pool and activated it, but I can't seem to create volumes in it with virsh or virt-install?
# virsh pool-dumpxml myrbdpool <pool type='rbd'> <name>myrbdpool</name> <uuid>2d786f7a-2df3-4d79-ae60-1535bcf1c6b5</uuid> <capacity unit='bytes'>6997998301184</capacity> <allocation unit='bytes'>10309227031</allocation> <available unit='bytes'>6977204658176</available> <source> <host name='ceph01.powercraft.nl' port='6789'/> <host name='ceph02.powercraft.nl' port='6789'/> <host name='ceph03.powercraft.nl' port='6789'/> <name>libvirt-pool</name> <auth type='ceph' username='libvirt'> <secret uuid='029a334e-ed57-4293-bb99-ffafa8867122'/> </auth> </source> </pool>
# virt-install --version 1.0.1
# virsh --version 1.2.9
I ended using virsh edit ceph-test.powercraft.nl and making creating the disk manually.
<disk type='network' device='disk'> <auth username='libvirt'> <secret type='ceph' uuid='029a334e-ed57-4293-bb99-ffafa8867122'/> </auth> <source protocol='rbd' name='libvirt-pool/kvm01-storage'> <host name='ceph01.powercraft.nl' port='6789'/> <host name='ceph02.powercraft.nl' port='6789'/> <host name='ceph03.powercraft.nl' port='6789'/> </source> <target dev='vdc' bus='virtio'/> </disk>
I use virt-install a lot to define, import and undefine domains, how can I use virt-install to manage my rdb disks?
You cannot use virt-install to manage any disks, it is used only to create domain XML and install the VM. Virsh is a command line tool for libvirt and there you can manage disks, however for ceph volume creation is not currently implemented so you need to create them manually.
Pavel
Kind regards,
Jelle de Jong
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users
_______________________________________________ libvirt-users mailing list libvirt-users@redhat.com https://www.redhat.com/mailman/listinfo/libvirt-users
participants (2)
-
Jelle de Jong
-
Pavel Hrdina