drbd 8.4

1,067 views
Skip to first unread message

Damien Churchill

unread,
Feb 27, 2013, 6:22:38 AM2/27/13
to gan...@googlegroups.com
Hi,

I've been having a look at adding support for drbd 8.4 since that's
what is now included in the current mainline kernel. I wanted to check
no one else was implementing this before doing it myself.

If no one else is working on this then I was wondering what the best
way to implement it would be? Options as far as I can see would be
either: create a new subclass of bdev.DRBD8 and then override all the
methods where the syntax of the command has changed or stick in a
bunch of if statements switching the syntax in the current bdev.DRBD8
class. The former seems cleaner to me, but I'm a bit unsure how you
would select the correct class?

Regards,
Damien

Iustin Pop

unread,
Feb 27, 2013, 7:04:14 AM2/27/13
to gan...@googlegroups.com
Hi Damien,

We're planning to work on supporting both drbd 9 and 8.4 with a new DRBD
template. This would need to actually be specified at instance creation
time.

I believe the same approach should be taken even if only 8.4 is
supported; as you mention, it's cleaner.

Note that we only planned this for later in the year (May or so?) so if
you can start working now on 8.4 it would be great; our focus will be on
9, with its new features.

regards,
iustin

Damien Churchill

unread,
Feb 27, 2013, 7:13:39 AM2/27/13
to gan...@googlegroups.com
On 27 February 2013 12:04, Iustin Pop <ius...@google.com> wrote:
> On Wed, Feb 27, 2013 at 11:22:38AM +0000, Damien Churchill wrote:
>> Hi,
>>
>> I've been having a look at adding support for drbd 8.4 since that's
>> what is now included in the current mainline kernel. I wanted to check
>> no one else was implementing this before doing it myself.
>>
>> If no one else is working on this then I was wondering what the best
>> way to implement it would be? Options as far as I can see would be
>> either: create a new subclass of bdev.DRBD8 and then override all the
>> methods where the syntax of the command has changed or stick in a
>> bunch of if statements switching the syntax in the current bdev.DRBD8
>> class. The former seems cleaner to me, but I'm a bit unsure how you
>> would select the correct class?
>
> Hi Damien,
>
> We're planning to work on supporting both drbd 9 and 8.4 with a new DRBD
> template. This would need to actually be specified at instance creation
> time.
>
> I believe the same approach should be taken even if only 8.4 is
> supported; as you mention, it's cleaner.
>

I've started heading down this road at the moment, found where the
classes are accessed down the bottom of the bdev module. Currently I
just have an if statement after the DEV_MAP is declared which checks
the drbd version and uses my DRBD84 class for the drbd template if the
system drbd module is 8.4. Not sure what you'll think of this
approach. I've uploaded the code to my github repo[0] for the time
being whilst I work on this.

> Note that we only planned this for later in the year (May or so?) so if
> you can start working now on 8.4 it would be great; our focus will be on
> 9, with its new features.
>

[0] https://github.com/damoxc/ganeti/tree/add-drbd8.4-support

Damien Churchill

unread,
Feb 27, 2013, 11:37:00 AM2/27/13
to gan...@googlegroups.com
The latest version in my tree for me seems to work for activating and
deactivating disks and migrating an instance. I need to go through and
tie into the unit tests, are there any docs for how to do this or is
it just a read the code situation?

Regards,
Damien

Iustin Pop

unread,
Feb 27, 2013, 11:45:58 AM2/27/13
to gan...@googlegroups.com
That works, and might be a possible way to implement drbd 8.4 support.
For drbd 9 we will need a separate class.

Whether you do it in/after DEV_MAP or actually directly in a base class,
it depends on how clean it is. Haven't looked at your code, btw.

> >> Note that we only planned this for later in the year (May or so?) so if
> >> you can start working now on 8.4 it would be great; our focus will be on
> >> 9, with its new features.
> >>
> >
> > [0] https://github.com/damoxc/ganeti/tree/add-drbd8.4-support
>
> The latest version in my tree for me seems to work for activating and
> deactivating disks and migrating an instance. I need to go through and
> tie into the unit tests, are there any docs for how to do this or is
> it just a read the code situation?

There are not many unit-tests per se (there are some, like parsing
/proc/drbd output, etc.); more work is in QA and the burning tool, which
exercise live these code paths.

regards,
iustin

Thomas Thrainer

unread,
Apr 9, 2013, 11:47:36 AM4/9/13
to gan...@googlegroups.com, ius...@google.com, dam...@gmail.com
Hi Damien,

are you still working on this feature? What is the current state of DRBD 8.4 support?
We want to add support for DRBD 8.4 (and DRBD 9 eventually) soon-ish, so maybe we could build on top of your work.

Cheers,
Thomas

Damien Churchill

unread,
Apr 9, 2013, 4:08:00 PM4/9/13
to Thomas Thrainer, gan...@googlegroups.com, Iustin Pop
Hi Thomas,

On 9 April 2013 16:47, Thomas Thrainer <thom...@google.com> wrote:
> Hi Damien,
>
> are you still working on this feature? What is the current state of DRBD 8.4
> support?
> We want to add support for DRBD 8.4 (and DRBD 9 eventually) soon-ish, so
> maybe we could build on top of your work.
>

Yes I have still been working on it. I think I still have some
uncommitted work on my desktop at the office, I'll push that to my git
repository tomorrow. I've been running the patches for some time on
our internal cluster. I think I still need to look at drive creation,
but most of the other bits and pieces (migration, failover,
activation, shutdown etc. etc.) appear to be working okay.

Regards,
Damien

Damien Churchill

unread,
Apr 10, 2013, 9:15:31 AM4/10/13
to Thomas Thrainer, gan...@googlegroups.com, Iustin Pop
Hi,

I've just pushed the latest code to github[0], I fixed the issue for
creating devices, the call to Open(force=True) was failing since the
-o flag on drbdsetup has been removed. The code is in the
add-drbd8.4-support branch.

One thing I've noticed whilst adding the support in is that its
resulted in a lot of code duplication (a lot of it my own fault I'll
admit) but it seems as though some abstraction of the drbd command
line tools would facilitate only having a single (or perhaps one for
8.x and one for 9) drbd bdev type.

Regards,
Damien

[0] https://github.com/damoxc/ganeti

Thomas Thrainer

unread,
Apr 10, 2013, 9:54:20 AM4/10/13
to Damien Churchill, gan...@googlegroups.com
Hi,

Great, thanks! I'll look into it and test it on a test cluster, and I'll let you know how it's going.

Cheers,
Thomas
--
Thomas Thrainer | Software Engineer | thom...@google.com | 

Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Katherine Stephens
Reply all
Reply to author
Forward
0 new messages