<div class="gmail_quote">On 30 October 2012 20:49, Eric Blake <span dir="ltr"><<a href="mailto:eblake@redhat.com" target="_blank">eblake@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div>On 10/30/2012 08:46 AM, Douglas Russell wrote:<br>
> I'm experimenting with how to attach storage to a guest virtual machine (I<br>
> sent another message to th elist about that as it's slightly different)<br>
><br>
> Looking in the XML files for my virtual machine, I see this:<br>
><br>
> <disk type='file' device='disk'><br>
>   <driver name='qemu' type='qcow2'/><br>
>   <source file='/vm/myvm/tmpeuiVc9.qcow2'/><br>
>   <target dev='hda' bus='ide'/><br>
>   <address type='drive' controller='0' bus='0' unit='0'/><br>
> </disk><br>
><br>
> However, /dev/hda is not a device in the guest. It is /dev/sda. It's not<br>
> really a problem in it's own right, but it's one of several connected<br>
> things which don't make sense. Is there some explanation for this?<br>
<br>
</div>The <target dev='...'> designation is a hint, and there for you to track<br>
things in the host, but does not necessarily reflect the name that the<br>
guest will choose for the same device (there is NO way for the host to<br>
force what the guest names things).<br></blockquote><div><br></div><div>Ok, that's fair enough, I was wondering how it would go about influencing the guest.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



However, for SCSI devices in the guest, you probably want to use <disk<br>
type='block' device='lun'> rather than type='file' device='disk'.<br></blockquote><div><br></div><div>You think I should change the above stanza or are you talking about the second ? The above storage really is a file.</div>


<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
[Caveat: I haven't used SCSI devices in my guests yet]<br>
<div><br>
><br>
> I believe this is linked to some weirdness when I attach some extra storage<br>
> like so:<br>
><br>
> virsh attach-disk myvm /dev/lvm-group1/mystorage sdb --driver qemu<br>
> --persistent<br>
><br>
> This adds the following stanza:<br>
><br>
> <disk type='block' device='disk'><br>
>   <driver name='qemu' type='raw'/><br>
>   <source dev='/dev/lvm-group1/mystorage'/><br>
>   <target dev='sdb' bus='scsi'/><br>
>   <address type='drive' controller='0' bus='0' unit='1'/><br>
> </disk><br>
><br>
> Looks about right. In the guest though, it pushes /dev/sda (root and swap<br>
> are here on sda1 and sda2) upto /dev/sdb (sdb1 and sdb2). Somehow it still<br>
> boots correctly despite fstab referrencing /dev/sda1 and /dev/sda2 for /<br>
> and swap. The new /dev/sda is this storage I tried to add as sdb. What<br>
> could be causing this?<br>
<br>
</div>Again, names in the XML don't have to reflect names chosen by the guest.<br>
 Beyond that, I don't have quite enough experience in this area of the<br>
code to give a definitive answer, but at least wanted to throw out an<br>
answer while you wait to see if anyone else also replies.<br></blockquote><div><br></div><div>Ok, makes sense. I'm still wondering how it's able to start properly though when the fstab is wrong though? It boots up and mounts /dev/sdb1 on /, fstab still says /dev/sda1 is /. </div>

<div><br></div><div>I've also started a new thread as hotplug is also not working for some reason.</div><div><br></div><div>Thanks.</div></div>