How to add new drbd9 volume on top of lvm from CLI

popcek

New Member
Jun 29, 2016
4
0
1
43
Hi;

I set up 2 node proxmox cluster with drbd9 shared storage (and using Lvm.lvm plugin on top of it). Everything is working fine from web console, adding new volume, deleting it and also mange to resize it from CLI.

Now I want to prepare new lvm volumes for my KVM servers and then dd-ing them from my current KVM setup.

I created new volume with:
$ drbdmanage add-resource myvm
$ drbdmanage add-volume myvm 100GB --deploy 2

I can see that volume on both nodes (drbdmanage volumes, lvs, ...). But I can't see it in webconsole under strorage->drbd1->content. Here I can see only volumes created from web console. Also when I try to insert /etc/pve/qemu-server/myvm.conf disk can't be opened.

I am receiving an error TASK ERROR: unable to parse lvm volume name 'myvm_00'.

So what i need to repair, that disks will also appear in web console and I am going to be able to use them in my vm-s configurations?

Regards.
 
Last edited:
Oh. I find it out ... i am totally new into proxmox world, but I rely like it for now:

$ pvesm alloc drbd1 101 vm-101-data 50G

Now I only need to know why the size of lvm is not exactly 50GB
...
vm-101-data_00 drbdpool -wi-ao---- 50.01g
....

Regards.
 
I don't understand how to specify exact size of volume size.
When creating with:
$ pvesm alloc drbd1 100 vm-100-webdev-01-root 40G
actually i get new disk 40.01G large? Why the size of disk is not exactly 40G?

$ lvdisplay /dev/drbdpool/vm-100-webdev-01-root_00
--- Logical volume ---
LV Path /dev/drbdpool/vm-100-webdev-01-root_00
LV Name vm-100-webdev-01-root_00
VG Name drbdpool
LV UUID 9FTpqS-UsTM-gSvb-6Kux-fIy5-JrH6-tT3rVn
LV Write Access read/write
LV Creation host, time proxmox-01, 2016-06-30 09:25:16 +0200
LV Status available
# open 2
LV Size 40.01 GiB
Current LE 10243
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 4096
Block device 251:2

I want that my disk is 10240 LE large. How to achieve this?
 
OK. Still learning. Maybe this will be helpfull for someoneelse:

- volume is 40.01G large because also contains some meta data
- volume /dev/drbd100 is 40G large and i need to copy data with dd on this volume

Correct me if I am wrong.