Mailing List Archive

Resize offline - Questions
Hi list,

I realized I am using drbd now for more than ten years and is has been a
joy all the time.

Now I have a request where I am really unsure how to deal with.

I have to resize a volume offline. Mainly because the carppy hypervisor
does not allow to enalrge virtual disks while the vm ist running.....

I checked the docs
<https://linbit.com/drbd-user-guide/drbd-guide-9_0-en/#s-growing-offline>
about offline resize. There are some questions remaining. It states I
have to edit the metadata file I created to match the sectors of the new
size. My question now is: where do I get this number from?

I tried to firgure out and match the current size with the current
volume but there is a mismatch:
===========================================
root@drbd1:~# grep la-size metatada.drbd1
la-size-sect 2306796728;
root@backuppc41:~# fdisk -l /dev/vdb
Disk /dev/vdb: 1,07 TiB, 1181116006400 bytes, 2306867200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
===========================================

So from where do I get the number of sectors (after having enlarged the
disk)?
Are there any other pitfalls?

Just to really make sure: There is no easier way to do? I mean how does
drbd recon the new size of the disk when online?
So this won't work?
-drbdadm down
-shut down VM
-enlarge disk
-power on VM
-start drbd realizing there is a new size ...

However, any clue for the main question about how to get the sectors?


Thanks a lot!

/Christian
Re: Resize offline - Questions [ In reply to ]
On Thu, Nov 25, 2021 at 05:04:30PM +0100, Christian V?lker wrote:
> Now I have a request where I am really unsure how to deal with.
>
> I have to resize a volume offline. Mainly because the carppy hypervisor does
> not allow to enalrge virtual disks while the vm ist running.....

hm, VM offline does not necessarily mean DRBD "offline", right. Is it
possible to shut down the VM, but keep DRBD connected/up, resize the
backing disks, grow DRBD online?

Regards, rck
_______________________________________________
Star us on GITHUB: https://github.com/LINBIT
drbd-user mailing list
drbd-user@lists.linbit.com
https://lists.linbit.com/mailman/listinfo/drbd-user
Re: Resize offline - Questions [ In reply to ]
Hi,
>> I have to resize a volume offline. Mainly because the carppy hypervisor does
>> not allow to enalrge virtual disks while the vm ist running.....
> hm, VM offline does not necessarily mean DRBD "offline", right. Is it
> possible to shut down the VM, but keep DRBD connected/up, resize the
> backing disks, grow DRBD online?
Maybe we have different ideas here- but how can I keep drbd "connected"
when the VM which hosts drbd is powered off? To make clear: Inside of a
VM drbd is up and running....

Thanks!

/Christian
Re: Resize offline - Questions [ In reply to ]
Not an expert, so don't get my words for granted. You can calculate
estimated metadata size by using the formula described in chapter "16.1.3.
Estimating meta data size" in the drbd user guide.

To check the current space (in sectors) allocated for metadata, subtract
the total disk size in sectors (assuming you are using /dev/vdb as the drbd
backing device, and not LVM on top of it) with current la-size-sect
(2306867200 - 2306796728=70472).You can then multiply the result with 512
to get the size in bytes (70472 x 512=36081664 Bytes or ~34.4Mbytes).

Since you are about to increase the vdisk size to 2TB (double its current
size), a safe guess would be to use the double size of the current metadata
allocation as well (70472 x 2).

You could take a snapshot of the VM before doing any changes just in case
something goes wrong. Even better, try reproducing your current setup on
two new VMs (disk sizes can be smaller) and test the above steps over
there, before applying them to the production VMs.

Good luck

On Mon, 29 Nov 2021 at 05:59, Christian Völker <knebb@knebb.de> wrote:

> Hi list,
>
> I realized I am using drbd now for more than ten years and is has been a
> joy all the time.
>
> Now I have a request where I am really unsure how to deal with.
>
> I have to resize a volume offline. Mainly because the carppy hypervisor
> does not allow to enalrge virtual disks while the vm ist running.....
>
> I checked the docs
> <https://linbit.com/drbd-user-guide/drbd-guide-9_0-en/#s-growing-offline>
> about offline resize. There are some questions remaining. It states I have
> to edit the metadata file I created to match the sectors of the new size.
> My question now is: where do I get this number from?
>
> I tried to firgure out and match the current size with the current volume
> but there is a mismatch:
> ===========================================
> root@drbd1:~# grep la-size metatada.drbd1
> la-size-sect 2306796728;
> root@backuppc41:~# fdisk -l /dev/vdb
> Disk /dev/vdb: 1,07 TiB, 1181116006400 bytes, 2306867200 sectors
> Units: sectors of 1 * 512 = 512 bytes
> Sector size (logical/physical): 512 bytes / 512 bytes
> I/O size (minimum/optimal): 512 bytes / 512 bytes
> ===========================================
>
> So from where do I get the number of sectors (after having enlarged the
> disk)?
> Are there any other pitfalls?
>
> Just to really make sure: There is no easier way to do? I mean how does
> drbd recon the new size of the disk when online?
> So this won't work?
> -drbdadm down
> -shut down VM
> -enlarge disk
> -power on VM
> -start drbd realizing there is a new size ...
>
> However, any clue for the main question about how to get the sectors?
>
>
> Thanks a lot!
>
> /Christian
> _______________________________________________
> Star us on GITHUB: https://github.com/LINBIT
> drbd-user mailing list
> drbd-user@lists.linbit.com
> https://lists.linbit.com/mailman/listinfo/drbd-user
>