adopting lvm disk to import foreign instance - error missing logical volume(s):

20 views
Skip to first unread message

dg tech

unread,
Apr 20, 2023, 1:10:39 AM4/20/23
to ganeti
Hi all, 

Running ganeti-3.0.2-1 on Debian 11 2-node cluster

I am trying to import a turnkey Linux appliance which comes as a vmdk.

ganeti docs say that we can add an instance and adopt an lvm 

syntax given is:
gnt-instance add -t plain -n HOME_NODE ... \
  --disk 0:adopt=lv_name[,vg=vg_name] INSTANCE_NAME

qemu-img info tells me the vmdk is 20GiB:
# qemu-img info turnkey-lamp-16.1-buster-amd64.vmdk
image: turnkey-lamp-16.1-buster-amd64.vmdk
file format: vmdk
virtual size: 20 GiB (21474836480 bytes)

So I created a volume of size 20G in the ganeti volume group:
# lvcreate --size 20G --name turnkey vg_ganeti

The LV is there in the correct VG:
# lvs
  LV                                              VG        Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  4d35578c-0b77-4cff-9fd3-39a33a092e05.disk0_data vg_ganeti -wi-ao----  15.00g                                           
  4d35578c-0b77-4cff-9fd3-39a33a092e05.disk0_meta vg_ganeti -wi-ao---- 128.00m                                                    
  55247a04-b533-4894-aad4-e47dfe701b96.disk0_data vg_ganeti -wi-ao----  40.00g                                                    
  55247a04-b533-4894-aad4-e47dfe701b96.disk0_meta vg_ganeti -wi-ao---- 128.00m                                                    
  67b99c3b-101e-4f35-86d1-fdf92a1f2f1d.disk0_data vg_ganeti -wi-ao----  30.00g                                                    
  67b99c3b-101e-4f35-86d1-fdf92a1f2f1d.disk0_meta vg_ganeti -wi-ao---- 128.00m                                                    
  6f3d461b-e0fc-4d00-805b-79a21ae43c9f.disk0_data vg_ganeti -wi-ao----  25.00g                                                    
  6f3d461b-e0fc-4d00-805b-79a21ae43c9f.disk0_meta vg_ganeti -wi-ao---- 128.00m                                                    
  d37bf489-8175-4a6a-a095-3a6da702697f.disk0_data vg_ganeti -wi-ao---- 255.00g                                                    
  d37bf489-8175-4a6a-a095-3a6da702697f.disk0_meta vg_ganeti -wi-ao---- 128.00m                                                    
  turnkey                                         vg_ganeti -wi-a-----  20.00g

Now I used qemu-img to copy the vmdk file as a raw image  to the lv
# qemu-img convert -p -f vmdk -O raw turnkey-lamp-16.1-buster-amd64.vmdk /dev/vg_ganeti/turnkey

Next I tried to create the instance and adopt the lvm as disk 0:

# gnt-instance add -n dgc-vmr-02 -t plain -o image+default \
  --disk 0:adopt=turnkey -B memory=4G  --no-start --no-install \
  --no-ip-check --no-name-check turnkey01

This throws an error:

Failure: prerequisites not met for this operation:
error type: wrong_input, error details:
Missing logical volume(s): vg_ganeti/turnkey

The cluster definitely uses the vg_ganeti volume group:
# gnt-cluster info | grep vg_ganeti
  lvm volume group: vg_ganeti
  lvm reserved volumes: vg_ganeti/voldiladele02
    metavg: vg_ganeti

and the kvm is part of it:
# lvdisplay /dev/vg_ganeti/turnkey
  --- Logical volume ---
  LV Path                /dev/vg_ganeti/turnkey
  LV Name                turnkey
  VG Name                vg_ganeti
  LV UUID                cB0DSC-NnJJ-FkBU-D7CT-HPee-rKw4-ctubN5
  LV Write Access        read/write
  LV Creation host, time dgc-vmr-01, 2023-04-19 16:27:56 +0100
  LV Status              available
  # open                 0
  LV Size                20.00 GiB
  Current LE             5120
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:13

gnt-cluster verify notices the lvm and calls it unknown:
# gnt-cluster verify
Submitted jobs 63387, 63388
Waiting for job 63387 ...
Wed Apr 19 16:47:40 2023 * Verifying cluster config
Wed Apr 19 16:47:40 2023 * Verifying cluster certificate files
Wed Apr 19 16:47:40 2023 * Verifying hypervisor parameters
Wed Apr 19 16:47:40 2023 * Verifying all nodes belong to an existing group
Waiting for job 63388 ...
Wed Apr 19 16:47:41 2023 * Verifying group 'default'
Wed Apr 19 16:47:41 2023 * Gathering data (2 nodes)
Wed Apr 19 16:47:41 2023 * Gathering information about nodes (2 nodes)
Wed Apr 19 16:47:42 2023 * Gathering disk information (2 nodes)
Wed Apr 19 16:47:42 2023 * Verifying configuration file consistency
Wed Apr 19 16:47:42 2023 * Verifying node status
Wed Apr 19 16:47:42 2023 * Verifying instance status
Wed Apr 19 16:47:42 2023 * Verifying orphan volumes
Wed Apr 19 16:47:42 2023   - WARNING: node dgc-vmr-01.test.local: volume vg_ganeti/turnkey is unknown
Wed Apr 19 16:47:42 2023 * Verifying N+1 Memory redundancy
Wed Apr 19 16:47:42 2023 * Other Notes
Wed Apr 19 16:47:43 2023 * Hooks Results

I am stumped.  Can anyone help?

Many thanks

Zed

Sascha Lucas

unread,
Apr 20, 2023, 2:55:10 PM4/20/23
to ganeti
Hi Zed,

On Wed, 19 Apr 2023, dg tech wrote:

> # gnt-instance add -n dgc-vmr-02 -t plain -o image+default \
> --disk 0:adopt=turnkey -B memory=4G --no-start --no-install \
> --no-ip-check --no-name-check turnkey01
>
> This throws an error:
>
> Failure: prerequisites not met for this operation:
> error type: wrong_input, error details:
> Missing logical volume(s): vg_ganeti/turnkey

> and the kvm is part of it:
> # lvdisplay /dev/vg_ganeti/turnkey
> --- Logical volume ---
> LV Path /dev/vg_ganeti/turnkey
> LV Name turnkey
> VG Name vg_ganeti
> LV UUID cB0DSC-NnJJ-FkBU-D7CT-HPee-rKw4-ctubN5
> LV Write Access read/write
> LV Creation host, time dgc-vmr-01, 2023-04-19 16:27:56 +0100
> LV Status available

> gnt-cluster verify notices the lvm and calls it unknown:
> # gnt-cluster verify
...
> Wed Apr 19 16:47:42 2023 - WARNING: node dgc-vmr-01.test.local: volume
> vg_ganeti/turnkey is unknown

It seems you just mixed your two nodes. The LV turnkey resides in
dgc-vmr-01 and you chose dgc-vmr-02 as the home node for disk adoption.

Other than that, it should work well.

HTH, Sascha.

dg tech

unread,
Apr 20, 2023, 4:26:28 PM4/20/23
to gan...@googlegroups.com
Hi Sacha,

SMH - blindness!  doh! doh!  You are correct.  It worked just fine.

I once spent 4 hours unable to spot a coding mistake involving = and == in C.  

if (a=b) ( ... } was my code, which should have been written as if (a==b) { ... }

Thanks a lot.

Zed

My friend saw it in 1 minute.

--
You received this message because you are subscribed to the Google Groups "ganeti" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ganeti+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ganeti/alpine.DEB.2.22.394.2304202049340.171170%40eyu.loc.
Reply all
Reply to author
Forward
0 new messages