From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shriram Rajagopalan Subject: Re: BLKTAP Date: Mon, 21 Nov 2011 22:56:47 -0800 Message-ID: References: <002401cca7e6$ec135b70$c43a1250$@ark-net.org> <000301cca8bb$1ebfaa90$5c3effb0$@ark-net.org> Reply-To: rshriram@cs.ubc.ca Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4758066349544042571==" Return-path: In-Reply-To: <000301cca8bb$1ebfaa90$5c3effb0$@ark-net.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Michael A. Collins" Cc: xen-devel@lists.xensource.com, xen-users@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============4758066349544042571== Content-Type: multipart/alternative; boundary=000e0ce0cd600288e504b24d51fc --000e0ce0cd600288e504b24d51fc Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On Mon, Nov 21, 2011 at 6:04 PM, Michael A. Collins < mike.a.collins@ark-net.org> wrote: > *From:* Shriram Rajagopalan [mailto:rshriram@cs.ubc.ca] > *Sent:* Monday, November 21, 2011 12:03 AM > *To:* Michael A. Collins > *Cc:* xen-devel@lists.xensource.com; xen-users@lists.xensource.com > *Subject:* Re: [Xen-devel] BLKTAP**** > > ** ** > > =85**** > > > drbd/remus - why do you need blktap ? > > shriram**** > > ** ** > > From my readings, I have found only a few examples of using remus. Most > of them refer to using the following stanza in the disk section of a VM= =92s > cfg file:**** > > tap2:remus:backuphost:anyfreeport|**** > > ** > Not sure if tap2 is the right syntax.. there was some issue a while ago, between tap & tap2 syntaxes. > ** > > That doesn=92t work for xl, but even using it with xm causes issues, sinc= e > there isn=92t a tap device without the kernel module. > correct - so far/ > So I also found out that drbd uses a tap device to handle the hook in > with Xen, so if you want to have automagic working with block-drbd xen > scripts then you have to use tap. > eh? I dont think so. with drbd based backend for xen VMs (with or without remus), you just use the drbd: syntax (much like phy:...). And then the block-drbd script in /etc/xen/scripts/ takes care of the rest of the magic. There is no tapdisk involved in this procedure. In essence, the block-drbd script just 1. parses the drbd: syntax to determine which one of the /dev/drbd[X] devices belong to the , 2. does some sanity checks 3. promotes in the host to "Primary" and then the rest of the control flow happens akin to a phy device, with /dev/drbd[X] being supplied as the path to the disk backend. You could do this manually too in two simple steps. 1. On the host where you want to launch the VM, promote the drbd disk to Primary (ensure that the other end is in secondary state) 2. change the VM's disk config to phy:/dev/drbd/by-res/ and you are good to go. [Though with remus, you ll have to hack the tools/python/xen/remus/device.py script to recognize the /dev/drbd/* URI.] With all that said and done, I=92m currently running drbd 8.3.11 since that= =92s > the version of the kernel module included with Linux 3.1, but I=92m just > using Xen=92s phy handler for the disk section of my VM=92s cfg file.**** > > ** ** > > I see that there is a nice howto for debian on remusha.wikidot.com, but > again it uses a 2.6.32 kernel from Jeremy=92s git repo, which has the tap > kernel module. I again assert that currently there is very little out > there that would help to get someone started using remus with drbd in the > linux 3.1.x world. I run remus at work, but it=92s using shared storage = and > have no need to use it with drbd, but at home I don=92t really want to se= t > that up, so I thought drbd would be a nice start.**** > > ** ** > > I=92ve started diffing the 8.3.9 branch of drbd with your changes for rem= us > and will see how hard it is to get that in the 8.3.11 version I=92m using= . * > *** > > ** > Is the remusified drbd (8.3.9) not compiling under the 3.1.x kernel anymore or are you interested in the latest version of DRBD + the remus stuff ? > ** > > With that being said, I mostly use xl for everything at home, I don=92t e= ven > have the xend service running, which makes matters worse, since I=92m sur= e > that most of remus uses the xend service and not the API to do the magic. > I am willing to document my steps and post to the wiki, so that others > could benefit from it!**** > > Mike**** > shriram --000e0ce0cd600288e504b24d51fc Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
On Mon, Nov 21, 2011 at 6:04 PM, Michael A. Coll= ins <mik= e.a.collins@ark-net.org> wrote:

From: Shriram Rajagopalan [mailto:rshriram@= cs.ubc.ca]
Sent: Monday, November 21, 2011 12:03 AM
To: Michael A. Co= llins
Cc: xen-devel@lists.xensource.com; xen-users@lists.xensource.com Subject: Re: [Xen-devel] BLKTAP

=A0

=85


drbd/remus - why=A0 do you need blktap ?

shriram

=A0

From my readings, I= have found only a few examples of using remus.=A0 Most of them refer to us= ing the following stanza in the disk section of a VM=92s cfg file:

tap2:remus:backuphost:any= freeport|

=A0


Not sure if tap2 is the right= syntax.. there was some issue a while ago, between tap & tap2
synta= xes.
=A0

That doesn=92t work for xl, but even using it wi= th xm causes issues, since there isn=92t a tap device without the kernel mo= dule.


correct - so far/
<= blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border= -left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

=A0 So I also found out that drbd uses a tap device to handle the hook i= n with Xen, so if you want to have automagic working with block-drbd xen sc= ripts then you have to use tap.=A0


eh? I dont think so. with drb= d based backend for xen VMs (with or without remus),
you just use the dr= bd:<resourceName> syntax (much like phy:...).
And then the block-= drbd script in /etc/xen/scripts/ takes care of the rest of the magic.
There is no tapdisk involved in this procedure.

In essence, the blo= ck-drbd script just
1. parses the drbd:<resourceName> syntax to d= etermine which one of
=A0the /dev/drbd[X] devices belong to the <res= ourceName>,
2. does some sanity checks
3. promotes <resourceName> in the host = to "Primary" and then

the rest of the control flow happen= s akin to a phy device, with /dev/drbd[X] being
supplied as the path to = the disk backend.

You could do this manually too in two simple steps.
=A01. On the hos= t where you want to launch the VM, promote the drbd disk to Primary
=A0(= ensure that the other end is in secondary state)
=A02. change the VM'= ;s disk config to
=A0phy:/dev/drbd/by-res/<resourceName>
=A0 and you are good to go.=
=A0 [Though with remus, you ll have to hack the tools/python/xen/remus/= device.py script to
=A0 recognize the /dev/drbd/* URI.]

With all that said a= nd done, I=92m currently running drbd 8.3.11 since that=92s the version of = the kernel module included with Linux 3.1, but I=92m just using Xen=92s phy= handler for the disk section of my VM=92s cfg file.

=A0<= /p>

I see that there is a = nice howto for debian on remusha.wikidot.com, but again it uses a 2.6.32 kernel from Jere= my=92s git repo, which has the tap kernel module.=A0 I again assert that cu= rrently there is very little out there that would help to get someone start= ed using remus with drbd in the linux 3.1.x world.=A0 I run remus at work, = but it=92s using shared storage and have no need to use it with drbd, but a= t home I don=92t really want to set that up, so I thought drbd would be a n= ice start.

=A0<= /p>

I=92ve started diffing= the 8.3.9 branch of drbd with your changes for remus and will see how hard= it is to get that in the 8.3.11 version I=92m using. =

<= /div>

Is the remusified drbd (8.3.9) not c= ompiling under the 3.1.x kernel anymore or are you interested in
the latest version of DRBD + the remus stuff ?
=A0

=A0

W= ith that being said, I mostly use xl for everything at home, I don=92t even= have the xend service running, which makes matters worse, since I=92m sure= that most of remus uses the xend service and not the API to do the magic.= =A0 I am willing to document my steps and post to the wiki, so that others = could benefit from it!

Mike=


shriram
--000e0ce0cd600288e504b24d51fc-- --===============4758066349544042571== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============4758066349544042571==--