LVM in KVM VM

tobru

Member
May 19, 2008
31
0
6
Hi,

I created a LVM Volume in a KVM VM (don't ask me why!). Now I have some troubles with this vm, when I try to start it, the following messages tell me that it can't find the VG created in this VM (ID 121, name quimby:
Code:
server:~# qm start 121
  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find all physical volumes for volume group quimby.
  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find all physical volumes for volume group quimby.
  Volume group "quimby" not found
command '/sbin/vgs --separator : --noheadings --units k --unbuffered --nosuffix --options vg_name,vg_size,vg_free' failed with exit code 5
  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find all physical volumes for volume group quimby.
  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find all physical volumes for volume group quimby.
  Volume group "quimby" not found
command '/sbin/vgs --separator : --noheadings --units k --unbuffered --nosuffix --options vg_name,vg_size,vg_free' failed with exit code 5
server:~#
Executing the LVM Tools on the server, gives me the following output:
Code:
server:~# pvdisplay
  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  --- Physical volume ---
  PV Name               /dev/sdc
  VG Name               vms1
  PV Size               200.00 GB / not usable 4.00 MB
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              51199
  Free PE               51199
  Allocated PE          0
  PV UUID               bNkfUv-q30i-eiUy-kP4S-Si68-ATxa-5ifFxo

  --- Physical volume ---
  PV Name               /dev/sdb
  VG Name               local2
  PV Size               931.51 GB / not usable 1.71 MB
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              238467
  Free PE               130430
  Allocated PE          108037
  PV UUID               3cpkof-hYb4-OYNm-C61j-bwd9-Eyjo-IwHaiD

  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find all physical volumes for volume group quimby.
  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find all physical volumes for volume group quimby.
  Volume group "quimby" not found
  Skipping volume group quimby
  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find all physical volumes for volume group quimby.
  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find all physical volumes for volume group quimby.
  Volume group "quimby" not found
  Skipping volume group quimby
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               pve
  PV Size               931.01 GB / not usable 3.19 MB
  Allocatable           yes
  PE Size (KByte)       4096
  Total PE              238338
  Free PE               1022
  Allocated PE          237316
  PV UUID               oRO3iF-wn1b-SoAQ-fmIi-E8cg-iX9v-nBJXtl
server:~#
Code:
server:~# vgdisplay
  --- Volume group ---
  VG Name               vms1
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  18
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               200.00 GB
  PE Size               4.00 MB
  Total PE              51199
  Alloc PE / Size       0 / 0
  Free  PE / Size       51199 / 200.00 GB
  VG UUID               dSNllz-EP0Z-zxqp-BkQw-K5tS-gvYt-b6SYzv

  --- Volume group ---
  VG Name               local2
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  6
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               1
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               931.51 GB
  PE Size               4.00 MB
  Total PE              238467
  Alloc PE / Size       108037 / 422.02 GB
  Free  PE / Size       130430 / 509.49 GB
  VG UUID               nRX7k1-HXPF-Obqi-OOWX-oOri-xYNP-nY5GK6

  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find all physical volumes for volume group quimby.
  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find all physical volumes for volume group quimby.
  Volume group "quimby" not found
  --- Volume group ---
  VG Name               pve
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  6
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               931.01 GB
  PE Size               4.00 MB
  Total PE              238338
  Alloc PE / Size       237316 / 927.02 GB
  Free  PE / Size       1022 / 3.99 GB
  VG UUID               LFI3cv-rSJo-Rcbi-3zeT-y4Kh-BuvF-f1zfcl

server:~#
Code:
server:~# lvdisplay
  --- Logical volume ---
  LV Name                /dev/local2/vm-120-disk-1
  VG Name                local2
  LV UUID                c3ah6H-j0Xc-S6o7-oHo0-OE07-wWyt-lyA6D2
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                40.01 GB
  Current LE             10242
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:3

  --- Logical volume ---
  LV Name                /dev/local2/vm-121-disk-1
  VG Name                local2
  LV UUID                wgEFAL-D7AO-dxi9-UKpB-a32y-xZqK-gjXwu8
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                32.01 GB
  Current LE             8195
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:4

  --- Logical volume ---
  LV Name                /dev/local2/vm-121-disk-2
  VG Name                local2
  LV UUID                IXPrnn-lS8O-j6BT-X4Ld-kew9-ie4w-7onbm3
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                350.00 GB
  Current LE             89600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:5

  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find all physical volumes for volume group quimby.
  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find all physical volumes for volume group quimby.
  Volume group "quimby" not found
  --- Logical volume ---
  LV Name                /dev/pve/swap
  VG Name                pve
  LV UUID                GAIMnx-8iCU-lrWJ-aZO3-xqEw-xOMy-duNIQ7
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                4.00 GB
  Current LE             1024
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0

  --- Logical volume ---
  LV Name                /dev/pve/root
  VG Name                pve
  LV UUID                W6UgI4-kL3I-wHMF-f2mL-xNMF-vFr4-YFaQgn
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                96.00 GB
  Current LE             24576
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1

  --- Logical volume ---
  LV Name                /dev/pve/data
  VG Name                pve
  LV UUID                UtMwlu-9dEp-Dvvv-rds8-y6ax-eT9J-QzjAWE
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                827.02 GB
  Current LE             211716
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:2

server:~#
Any ideas what I can do to start this vm?

Thanks a lot!
Best Regards,
Tobias
 
Yes, that's right, I have a problem with the LVM =)

The missing Volume Group "quimby" is on the 2nd drive of VM 21. And the 2nd drive of VM 21 is the Logical Volume /dev/local2/vm-121-disk-2 which is on the host of this VM. So I don't understand is why the host has a problem with this VG, which is in the LV of the VM...
Code:
  --- Logical volume --- *** LV of VM 21, 2nd drive
  LV Name                /dev/local2/vm-121-disk-2
  VG Name                local2
  LV UUID                IXPrnn-lS8O-j6BT-X4Ld-kew9-ie4w-7onbm3
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                350.00 GB
  Current LE             89600
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:5

  *** Comment: VG in VM 21 ***
  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find all physical volumes for volume group quimby.
  Couldn't find device with uuid 'wNwUfO-9NBJ-0Bum-Vai9-HXs2-DuU2-nvS3G7'.
  Couldn't find all physical volumes for volume group quimby.
  Volume group "quimby" not found
There is no missing drive in this host, all are there and working fine. After I created the VG "quimby" in VM 21, this problems appeared suddenly on the host (I stopped the VM and could not start it again because of this error)...
 
Yes, that's right, I have a problem with the LVM =)

You directly pass devices to the guest, and create VGs on them? I think this is a very bad idea, because the gues can influence the host then. Also, it seem that the guest drives have other IDs. Difficult to say what happens without more info (guest configuration, storage configuration)
 
I can't create any VM's on this node anymore. So I can't reproduce this error... But if I remember correct, I did the following steps:

  1. Created new VM (KVM):
    Disk Storage: LVM (local2)
    Disk Type: virtio
  2. Installed Ubuntu Server 9.10 inside this VM
  3. Added 2nd harddisk:
    Disk Storage: LVM (local2)
    Disk Type: virtio
  4. Restarted VM
  5. Created LVM volume inside this VM on the 2nd harddisk
After this, everything was OK, until I tried to create a new VM on this host. I always get the following error: " [5898]ERR: 24: Error in Perl code: command '/sbin/vgs --separator : --noheadings --units k --unbuffered --nosuffix --options vg_name,vg_size,vg_free' failed with exit code 5"

I'm aware that this is bad what I did and won't do it again...

pveversion:
Code:
pve-manager: 1.4-10 (pve-manager/1.4/4403)
qemu-server: 1.1-8
pve-kernel: 2.6.24-18
pve-qemu-kvm: 0.11.0-2
pve-firmware: 1
vncterm: 0.9-2
vzctl: 3.0.23-1pve3
vzdump: 1.2-5
vzprocps: 2.0.11-1dso2
vzquota: 3.0.11-1