drbd-user March 2010 archive
Main Archive Page > Month Archives  > drbd-user archives
drbd-user: [DRBD-user] Initialize empty volume

[DRBD-user] Initialize empty volume

From: dbarker <dbarker_at_nospam>
Date: Fri Mar 12 2010 - 21:07:42 GMT
To: drbd-user@lists.linbit.com

I tried and failed many times to quickly create empty drbd disks. The best
instructions I found appeared to work, but at the final connect, the entire
volume (with no filesystem installed at all) resyncd. This occurred even
using the "Truck Based" instructions.

However, if I define a 1G disk, and let that sync (that happens quickly),
and then resize the disk to 200G (or whatever) using the process for Growing
Offline, it's nearly instant! Then, I define or expand the file system and
proceed.

I must be doing something wrong with the --clear-bitmap new-current-uuid,
but what I've found to work may be helpful to someone else. All the
instructions I found were very hazy on which commands occurred on which drbd
instance, and in what order. Also, there were missing steps or the
instructions didn't match 8.3.0.

Environment:
Both drbd.8.3.0 instances are virtual machines running Debian 503 on ESXi
4u1. Each ESXi has two, local disks (besides the boot volume). iscsi-target
serves up both disks to either host. Both LUN are primary/primary on both
sides. Failover is not needed - if one drbd or disk or ESXi fails, I can add
to inventory, power on any affected vm using the other ESXi and plan my
recovery at my leisure.

Procedure:
Add a 1G disk, provisioned thin to each drbd vm, and synchronize normally.
My config is below. Note: Without the csums-alg statement, the target of the
sync grows to full size. With the csums-alg, the thin provisioning of my
disks is honored.

Example showing expanding r1 while impacting r0 for as little as possible.

Suspend any machines on r0 or r1

On both drbd vm:
  ietadm --op delete --tid=1 --lun=1
  drbdadm dump-md r1 > metadatar1
  resize disk using the VI Client
  reboot

Power on any machines on r0

  edit la-size-sec to new total
    (use cfdisk, u, and add the two numbers - 25G = 52419967, 100G =
209712382)
  drbdadm create-md r1
  drbdmeta_cmd=$(drbdadm -d dump-md r1)
  ${drbdmeta_cmd/dump-md/restore-md} metadatar1
  drbdadm up r1
  drbdadm primary r1
  ietadm --op new --tid=1 --lun=1 --params
Path=/dev/drbd2,Type=blockio,ScsiSN=SPIDSK-090312-00

rescan using the VI Client
add new extent to datastore using the VI Client
(rescan on the other vm too)

Power on any machines on r1

hth

Dan Barker

drbd.conf:
global {
  usage-count yes;
}
common {
  protocol C;
  syncer {
   rate 25M;
   csums-alg md5;
  }
  net { allow-two-primaries; }
}

resource r0 {
  startup { become-primary-on both; }
  device /dev/drbd1;
  disk /dev/sdb;
  meta-disk internal;
  on Storage00 {
    address 172.30.0.40:7789;
  }
  on Storage01 {
    address 172.30.0.41:7789;
  }
}

resource r1 {
  startup { become-primary-on both; }
  device /dev/drbd2;
  disk /dev/sdc;
  meta-disk internal;
  on Storage00 {
    address 172.30.0.40:7790;
  }
  on Storage01 {
    address 172.30.0.41:7790;
  }
}

ietd.conf:
Target iqn.2010-03.com.visioncomm.Storage00:Storage00
Lun 0 Path=/dev/drbd1,Type=blockio,ScsiSN=SPIDSK-090311-00
Lun 1 Path=/dev/drbd2,Type=blockio,ScsiSN=SPIDSK-090312-00
Alias iDISK0

-- View this message in context: http://old.nabble.com/Initialize-empty-volume-tp27882839p27882839.html Sent from the DRBD - User mailing list archive at Nabble.com. _______________________________________________ drbd-user mailing list drbd-user@lists.linbit.com http://lists.linbit.com/mailman/listinfo/drbd-user