<tt><span style=" font-size:10pt">Laine Stump <laine@laine.org>
wrote on 2021/07/17 00:01:36:<br><br>> From: Laine Stump <laine@laine.org></span></tt><br><tt><span style=" font-size:10pt">> To: Libvirt <libvir-list@redhat.com></span></tt><br><tt><span style=" font-size:10pt">> Cc: Motohiro Kawahito <JL25131@jp.ibm.com>,
"Daniel P. Berrangé" <br>> <berrange@redhat.com></span></tt><br><tt><span style=" font-size:10pt">> Date: 2021/07/17 00:01</span></tt><br><tt><span style=" font-size:10pt">> Subject: [EXTERNAL] Re: Question
about skipping virDomainDiskDefAssignAddress</span></tt><br><tt><span style=" font-size:10pt">> <br>> On 7/16/21 8:51 AM, Daniel P. Berrangé wrote:<br>> > On Fri, Jul 16, 2021 at 09:49:40PM +0900, Motohiro Kawahito wrote:<br>> >>> From: "Daniel P. Berrangé" <berrange@redhat.com><br>> >>> To: Motohiro Kawahito <JL25131@jp.ibm.com><br>> >>> Cc: libvir-list@redhat.com<br>> >>> Date: 2021/07/16 17:22<br>> >>> Subject: [EXTERNAL] Re: Question about skipping<br>> >> virDomainDiskDefAssignAddress<br>> >>><br>> >>> On Fri, Jul 16, 2021 at 01:01:50PM +0900, Motohiro Kawahito
wrote:<br>> >>>>> From: "Daniel P. Berrangé" <berrange@redhat.com><br>> >>>>> To: Motohiro Kawahito <JL25131@jp.ibm.com><br>> >>>>> Cc: libvir-list@redhat.com<br>> >>>>> Date: 2021/07/16 00:42<br>> >>>>> Subject: [EXTERNAL] Re: Question about skipping<br>> >>>> virDomainDiskDefAssignAddress<br>> >>>>><br>> >>>><br>> >>>>> With the exception of paravirtualized Xen guests,
this field in<br>> >>>>> libvirt XML is *completely* independant of the
guest assigned<br>> >>>>> device name.<br>> >>>>><br>> >>>>> eg the XML might say /dev/vda, but the guest
might decde to<br>> >>>>> call it /dev/sda, or /dev/whatever or really
absolutely<br>> >>>>> anything.<br>> >>>><br>> >>>> Thank you very much for this information! I understand
it.<br>> >>>> However, I don't understand how we can pass the target
device<br>> >> information<br>> >>>> (e.g. 0A80) without an error. Do you know how to
do it?<br>> >>>><br>> >>>> My question was not good, so I opened another thread
(How do we<br>> >> specify<br>> >>>> disk device names for non-Linux VMs in XML?).<br>> >>><br>> >>> There is nothing that needs passing. The guest OS decides
its naming<br>> >>> however it wants to.<br>> >><br>> >> We need to control device number from user. This device number
would be<br>> >> used later, such as detach-disk. Can we pass device number
from outside?<br>> > <br>> > Detach-disk requires the same information that is provided when
the<br>> > disk is first configured in libvir. This is completely separate
to the<br>> > device number / name seen inside the guest.<br>> <br>> To expand on that, in the case of detaching a disk, you could 1) provide
<br>> the target dev in the XML you give to "virsh detach-device",
2) give the <br>> target dev name that you provided in the original XML when you call
<br>> "virsh detach-disk", or 3) you could specify a custom alias
in the <br>> original XML ("<alias name='ua-somename'/>" - note
that the leading <br>> "ua-" is *required* for a custom alias name) and then give
that same <br>> alias to "virsh detach-device-alias". All three will allow
you to <br>> reliably select the disk you want, and have the same result.<br>> <br></span></tt><br><span style=" font-size:10pt;font-family:sans-serif">Laine and Daniel,
thank you very much for your comments. It's good to know the flexibility
in the naming convention. However, I found libvirtd rejects a non-Linux
device (i.e. '0A84') as a target device. The following two commands return
an error message, "Unknown disk name '0A84'". Can you let me
know how we specify an unusual name, like '0A84'?</span><br><br><span style=" font-size:10pt;font-family:sans-serif">$ virsh attach-disk
sample_domain /volumes/user.qcow2 0A84</span><br><span style=" font-size:10pt;font-family:sans-serif">$ virsh detach-disk
sample_domain 0A84</span><br><br><span style=" font-size:10pt;font-family:sans-serif">If we should use
an alias, could you advise me how to specify? Thank you so much again for
your help.</span><BR>
<BR>