From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LStut-00041M-RY for qemu-devel@nongnu.org; Fri, 30 Jan 2009 09:00:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LStut-00041A-6s for qemu-devel@nongnu.org; Fri, 30 Jan 2009 09:00:19 -0500 Received: from [199.232.76.173] (port=44127 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LStut-000417-3R for qemu-devel@nongnu.org; Fri, 30 Jan 2009 09:00:19 -0500 Received: from mail-gx0-f12.google.com ([209.85.217.12]:58282) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LStus-0007XU-I0 for qemu-devel@nongnu.org; Fri, 30 Jan 2009 09:00:18 -0500 Received: by gxk5 with SMTP id 5so541438gxk.10 for ; Fri, 30 Jan 2009 06:00:18 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20090129224756.GI13481@us.ibm.com> References: <20090129224756.GI13481@us.ibm.com> Date: Fri, 30 Jan 2009 09:00:17 -0500 Message-ID: Subject: Re: [Qemu-devel] virtio_blk unique device ID From: Jule Slootbeek Content-Type: multipart/alternative; boundary=000e0cd4cd46f8a54a0461b39f8a Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ryan Harper , qemu-devel@nongnu.org --000e0cd4cd46f8a54a0461b39f8a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit correct, however that would assume there is a file system on that block device the device ID should be able to be used without the existance of a FS. ubuntu@kvm:~$ sudo /lib/udev/scsi_id -g -u --page=0x83 /dev/sdf 360060480000190300570533030313044 ubuntu@kvm:~$ blkid /dev/sdf1 /dev/sdf1: UUID="e149b893-2970-46d8-9ee4-322d6a589828" SEC_TYPE="ext2" TYPE="ext3" On Thu, Jan 29, 2009 at 5:47 PM, Ryan Harper wrote: > * Jule Slootbeek [2009-01-29 16:13]: > > All, > > I was recently testing the workings of virtio to provision SAN block > devices > > to a domain, which worked great! However, i could not find a way to find > the > > UID of a virto_blk device. The scenario I had created was the following. > a > > LUN provisioned to my KVM (kvm-83) hypervisor over two paths, both paths > > mapped to my domain using virtio_blk. When configuring multipath-tools in > > the domain I could not find a way to find the UID of the LUN in order to > > create the multipath config. On a SCSI device, I would use the > > /lib/udev/scsi_id tools to discover this ID. I am using libvir/qemu 0.5.1 > in > > Ubuntu Jaunty Alpha-3 as hypervisor and virtual machine. > > Does the virtio_blk driver provide a UID to its devices, and is there a > way > > to get this ID in userspace? > > use uuid? Some distros (Ubuntu for example) mount via UUID > > % blkid > /dev/vda1: UUID="6331275f-f10d-4684-8aa8-e8aca1582b9d" TYPE="swap" > /dev/vda2: UUID="cf121062-fd27-4151-8a68-6cb940e449fe" TYPE="ext3" > > # ls -al /dev/disk/by-uuid/ > total 0 > lrwxrwxrwx 1 root root 10 Jan 29 17:10 6331275f-f10d-4684-8aa8-e8aca1582b9d > -> ../../vda1 > lrwxrwxrwx 1 root root 10 Jan 29 17:10 cf121062-fd27-4151-8a68-6cb940e449fe > -> ../../vda2 > > -- > Ryan Harper > Software Engineer; Linux Technology Center > IBM Corp., Austin, Tx > ryanh@us.ibm.com > --000e0cd4cd46f8a54a0461b39f8a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
correct, however that would assume there is a file system on that block= device
the device ID should be able to be used without the existance of= a FS.

ubuntu@kvm:~$ sudo /lib/udev/scsi_id -g -u --page=3D0x83 /dev= /sdf
360060480000190300570533030313044
ubuntu@kvm:~$ blkid /dev/sdf1
/dev/= sdf1: UUID=3D"e149b893-2970-46d8-9ee4-322d6a589828" SEC_TYPE=3D&q= uot;ext2" TYPE=3D"ext3"


On Thu, Jan 29, 2009 at 5:47 PM, Ryan Harper <ryanh@us.ibm.com> wrote:
* Jule Slootbeek = <jsslists@gmail.com> [2009-= 01-29 16:13]:
> All,
> I was recently testing the workings of virtio to provision SAN block d= evices
> to a domain, which worked great! However, i could not find a way to fi= nd the
> UID of a virto_blk device. The scenario I had created was the followin= g. a
> LUN provisioned to my KVM (kvm-83) hypervisor over two paths, both pat= hs
> mapped to my domain using virtio_blk. When configuring multipath-tools= in
> the domain I could not find a way to find the UID of the LUN in order = to
> create the multipath config. On a SCSI device, I would use the
> /lib/udev/scsi_id tools to discover this ID. I am using libvir/qemu 0.= 5.1 in
> Ubuntu Jaunty Alpha-3 as hypervisor and virtual machine.
> Does the virtio_blk driver provide a UID to its devices, and is there = a way
> to get this ID in userspace?

use uuid?  Some distros (Ubuntu for example) mount via UUI= D

% blkid
/dev/vda1: UUID=3D"6331275f-f10d-4684-8aa8-e8aca1582b9d" TYPE=3D&= quot;swap"
/dev/vda2: UUID=3D"cf121062-fd27-4151-8a68-6cb940e449fe" TYPE=3D&= quot;ext3"

# ls -al /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 Jan 29 17:10 6331275f-f10d-4684-8aa8-e8aca1582b9d= -> ../../vda1
lrwxrwxrwx 1 root root 10 Jan 29 17:10 cf121062-fd27-4151-8a68-6cb940e449fe= -> ../../vda2

--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh@us.ibm.com

--000e0cd4cd46f8a54a0461b39f8a--