Bug 1045107
Summary: | RFE: virsh: Support network disk parameters for attach-disk | ||
---|---|---|---|
Product: | [Community] Virtualization Tools | Reporter: | Shanzhi Yu <shyu> |
Component: | libvirt | Assignee: | Libvirt Maintainers <libvirt-maint> |
Status: | CLOSED DEFERRED | QA Contact: | |
Severity: | low | Docs Contact: | |
Priority: | low | ||
Version: | unspecified | CC: | berrange, crobinso, dyuan, hhan, mzhan, xuzhang, zminds |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | LibvirtFirstBug | ||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-04-17 16:49:12 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Shanzhi Yu
2013-12-19 15:53:57 UTC
Met the same issue when hotplugging a rbd based storage disk by using attach-disk. # qemu-img info rbd:libvirt-pool/test1.img image: rbd:libvirt-pool/test1.img file format: raw virtual size: 1.0G (1073741824 bytes) disk size: unavailable cluster_size: 4194304 # virsh attach-disk vm1 rbd:libvirt-pool/test1.img vdb error: Failed to attach disk error: Cannot access storage file 'rbd:libvirt-pool/test1.img' (as uid:107, gid:107): No such file or directory virsh # pool-dumpxml testvol <pool type='gluster'> <name>testvol</name> <uuid>910525a3-1119-4b97-a873-8342544a1507</uuid> <capacity unit='bytes'>39700525056</capacity> <allocation unit='bytes'>15881662464</allocation> <available unit='bytes'>23818862592</available> <source> <host name='192.168.199.5'/> <dir path='/'/> <name>testvol</name> </source> </pool> virsh # vol-list testvol 名称 路径 ------------------------------------------------------------------------------ 123.img gluster://192.168.199.5/testvol/123.img 456 gluster://192.168.199.5/testvol/456 centos.img gluster://192.168.199.5/testvol/centos.img test.img gluster://192.168.199.5/testvol/test.img virsh # start centos 错误:开始域 centos 失败 错误:Cannot access storage file 'gluster://192.168.199.5/testvol/123.img' (as uid:107, gid:107): 没有那个文件或目录 virsh # Moving to upstream tracker, since the BZ traces just the fact that 'virsh attach-disk' isn't able to generate the XML for network disks. Networked disks can be attached via 'virsh attach-device' when providing the correct XML. This is a user interface enhancement. An example commit extending virsh attach-disk with the --iothread option: https://github.com/libvirt/libvirt/commit/bc5a8090afa84095634ccee1e1a6ca9a2a9b177a commit bc5a8090afa84095634ccee1e1a6ca9a2a9b177a Author: John Ferlan <jferlan> Date: Tue Sep 2 11:20:41 2014 -0400 virsh: Add iothread to 'attach-disk' All the parameters to add for network disk support: --source-protocol --source-name --source-host-name (maybe take host:port syntax too) --source-host-transport --source-host-socket Then the extra bit would be teaching it to decode gluster:// style URLs into those correct parameters. Here's several example disk configs that we'd want to be able to generate: <disk type='network' device='disk'> <driver name='qemu' type='raw'/> <source protocol='http' name='/my-file.img'> <host name='example.org'/> </source> <target dev='vdaa' bus='virtio'/> </disk> <disk type='network' device='disk'> <driver name='qemu' type='raw'/> <source protocol='nbd'> <host transport='unix' socket='/var/run/nbdsock'/> </source> <target dev='vdab' bus='virtio'/> </disk> <disk type='network' device='disk'> <driver name='qemu' type='raw'/> <source protocol='rbd' name='pool/image'> <host name='mon1.example.org' port='6321'/> <host name='mon2.example.org' port='6322'/> <host name='mon3.example.org' port='6322'/> </source> <target dev='vdac' bus='virtio'/> </disk> <disk type='network' device='disk'> <driver name='qemu' type='raw'/> <source protocol='sheepdog' name='image,with,commas'> <host name='example.org' port='6000'/> </source> <target dev='vdad' bus='virtio'/> </disk> <disk type='network' device='disk'> <driver name='qemu' type='raw'/> <source protocol='gluster' name='test-volume/test-gluster2.raw'> <host name='192.168.1.100'/> </source> <target dev='vdae' bus='virtio'/> </disk> This issue is now tracked in https://gitlab.com/libvirt/libvirt/-/issues/16 |