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

Cole Robinson crobinso at redhat.com
Thu Jan 7 16:10:32 UTC 2016


On 01/07/2016 07:04 AM, Peter Crowther wrote:
> 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 for the report. Known issue, there isn't a fix, but it's on my todo
list. Might be a month or so though, I need to set up a bunch of network
storage servers (again)

- Cole




More information about the virt-tools-list mailing list