virt-install copies part of a pool's definition into a domain's disk definition - should it copy more or less?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to use virt-install to create a domain where the disks are on a Ceph storage pool.  I've created a libvirt pool as follows:

ID=kvm
POOL=vmlive
SECRET_UUID=036f507c-d66c-4fa6-a624-6764e6c77996

POOL_DEFINITION_FILE=~/pool-$POOL.xml
cat > $POOL_DEFINITION_FILE << EOF
<pool type="rbd">
  <name>$POOL</name>
  <source>
    <name>$POOL</name>
    <host name="test1" port="6789" />
    <host name="test2" port="6789" />
    <auth username='$ID' type='ceph'>
      <secret uuid='$SECRET_UUID'/>
    </auth>
  </source>
</pool>
EOF
virsh pool-define $POOL_DEFINITION_FILE
rm -f $POOL_DEFINITION_FILE
virsh pool-autostart $POOL
virsh pool-start $POOL

I'm then using virt-install to try to create a domain:

NAME=testguest
DEV=vda
SIZE=8G
IMAGE=CentOS-7-x86_64-Minimal-1503-01.iso
VCPUS=1
RAM=512
MACLAST_HEX=10
IPLAST_DECIMAL=16

FILE=$NAME-$DEV
qemu-img create -f rbd rbd:$POOL/$FILE $SIZE
sudo virt-install \
--connect qemu:///system \
--virt-type kvm \
--name $NAME \
--ram $RAM \
--vcpus=$VCPUS \
--disk vol=$POOL/$FILE \
--location /var/lib/libvirt/images/$IMAGE \
--vnc \
--noautoconsole \
--os-type linux \
--os-variant rhel7 \
--network=bridge:virbr0,model=virtio,mac=52:54:00:00:00:$MACLAST_HEX \
--autostart

If I run the above with --print-xml, the generated XML includes the following definition for the disk:

    <disk type="network" device="disk">
      <driver name="qemu"/>
      <source protocol="rbd" name="vmlive/testguest-vda">
        <host name="test1" port="6789"/>
      </source>
      <target dev="vda" bus="virtio"/>
    </disk>

This has parsed enough of the pool definition to replace the libvirt pool with much of its definition, but has excluded the vital <auth> part.

Should virt-install include more of the pool's data here, or less?  I'd naively suggest less and give the user as much freedom as possible to change the pool definition in the future.

Has anyone else encountered this problem and is there a known fix for my use case?  I've not found one after reasonably extensive searching, but my Google-fu isn't always perfect.

If you're reading this and there is a known fix, can you point me to it?

Thanks!

- Peter
--
Peter Crowther, Director, Melandra Limited

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list

[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux