From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Resizing block devices live? Date: Tue, 18 Dec 2012 13:52:02 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3215671426408071363==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "xen-devel@lists.xen.org" , =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= , Konrad Rzeszutek Wilk , Ian Campbell List-Id: xen-devel@lists.xenproject.org --===============3215671426408071363== Content-Type: multipart/alternative; boundary=20cf307ac7976d029104d120cd1c --20cf307ac7976d029104d120cd1c Content-Type: text/plain; charset=ISO-8859-1 One of the requests from the xenorg.uservoice.com page that had a moderate amount of interest was to allow block devices to be resized. There's a description here: https://xenorg.uservoice.com/forums/172169-xen-development/suggestions/3140313-implement-block-device-resize I have no idea what this would take -- can anyone comment? -George --20cf307ac7976d029104d120cd1c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
One of the requests from the xenorg.uservoice.com page that had a moderate amou= nt of interest was to allow block devices to be resized.=A0 There's a d= escription here:

https://xenorg.uservoice.= com/forums/172169-xen-development/suggestions/3140313-implement-block-devic= e-resize

I have no idea what this would take -- can anyone comment?
=A0-George
--20cf307ac7976d029104d120cd1c-- --===============3215671426408071363== 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.xen.org http://lists.xen.org/xen-devel --===============3215671426408071363==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: Resizing block devices live? Date: Tue, 18 Dec 2012 13:58:07 +0000 Message-ID: <1355839087.14620.219.camel@zakaz.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: Roger Pau Monne , Konrad Rzeszutek Wilk , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Tue, 2012-12-18 at 13:52 +0000, George Dunlap wrote: > One of the requests from the xenorg.uservoice.com page that had a > moderate amount of interest was to allow block devices to be resized. > There's a description here: > > https://xenorg.uservoice.com/forums/172169-xen-development/suggestions/3140313-implement-block-device-resize > > > I have no idea what this would take -- can anyone comment? Doesn't that already work? I thought this was patch in the PV block drivers ages ago... Yes, http://wiki.xen.org/wiki/XenParavirtOps lists it under 2.6.36. Maybe this is a missing feature of (lib)xl vs xend? Ian. From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: Resizing block devices live? Date: Tue, 18 Dec 2012 14:06:56 +0000 Message-ID: References: <1355839087.14620.219.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5159641094121354598==" Return-path: In-Reply-To: <1355839087.14620.219.camel@zakaz.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: Konrad Rzeszutek Wilk , "xen-devel@lists.xen.org" , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org --===============5159641094121354598== Content-Type: multipart/alternative; boundary=20cf307ac797b2f8ed04d12102a9 --20cf307ac797b2f8ed04d12102a9 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Dec 18, 2012 at 1:58 PM, Ian Campbell wrote: > On Tue, 2012-12-18 at 13:52 +0000, George Dunlap wrote: > > One of the requests from the xenorg.uservoice.com page that had a > > moderate amount of interest was to allow block devices to be resized. > > There's a description here: > > > > > https://xenorg.uservoice.com/forums/172169-xen-development/suggestions/3140313-implement-block-device-resize > > > > > > I have no idea what this would take -- can anyone comment? > > Doesn't that already work? I thought this was patch in the PV block > drivers ages ago... > > Yes, http://wiki.xen.org/wiki/XenParavirtOps lists it under 2.6.36. > > Maybe this is a missing feature of (lib)xl vs xend? > "xm help" doesn't show a "block-resize" command, nor does grepping through tools for "resize" turn up anything. Would someone be willing to do some investigation into whether such a command is implemented in the protocol, and what it would take to get a "xm block-resize" command working? (Not necessarily do it, but have an idea what probably needs to be done.) -George --20cf307ac797b2f8ed04d12102a9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Tue, Dec 18, 2012 at 1:58 PM, Ian Campbell <Ian.= Campbell@citrix.com> wrote:
On T= ue, 2012-12-18 at 13:52 +0000, George Dunlap wrote:
> One of the requests from the xenorg.uservoice.com page that had a
> moderate amount of interest was to allow block devices to be resized.<= br> > There's a description here:
>
> https:= //xenorg.uservoice.com/forums/172169-xen-development/suggestions/3140313-im= plement-block-device-resize
>
>
> I have no idea what this would take -- can anyone comment?

Doesn't that already work? I thought this was patch in the = PV block
drivers ages ago...

Yes, = http://wiki.xen.org/wiki/XenParavirtOps lists it under 2.6.36.

Maybe this is a missing feature of (lib)xl vs xend?
"xm help" doesn't show a "block-resize"= ; command, nor does grepping through tools for "resize" turn up a= nything.

Would someone be willing to do some investigation into wheth= er such a command is implemented in the protocol, and what it would take to= get a "xm block-resize" command working?=A0 (Not necessarily do = it, but have an idea what probably needs to be done.)

=A0-George
--20cf307ac797b2f8ed04d12102a9-- --===============5159641094121354598== 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.xen.org http://lists.xen.org/xen-devel --===============5159641094121354598==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: Resizing block devices live? Date: Tue, 18 Dec 2012 14:34:54 +0000 Message-ID: <50D08D1E02000078000B112D@nat28.tlf.novell.com> References: <1355839087.14620.219.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: "xen-devel@lists.xen.org" , Ian Campbell , Konrad Rzeszutek Wilk , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org >>> On 18.12.12 at 15:06, George Dunlap wrote: > On Tue, Dec 18, 2012 at 1:58 PM, Ian Campbell wrote: > >> On Tue, 2012-12-18 at 13:52 +0000, George Dunlap wrote: >> > One of the requests from the xenorg.uservoice.com page that had a >> > moderate amount of interest was to allow block devices to be resized. >> > There's a description here: >> > >> > >> > https://xenorg.uservoice.com/forums/172169-xen-development/suggestions/3140313-i > mplement-block-device-resize >> > >> > >> > I have no idea what this would take -- can anyone comment? >> >> Doesn't that already work? I thought this was patch in the PV block >> drivers ages ago... >> >> Yes, http://wiki.xen.org/wiki/XenParavirtOps lists it under 2.6.36. >> >> Maybe this is a missing feature of (lib)xl vs xend? >> > > "xm help" doesn't show a "block-resize" command, nor does grepping through > tools for "resize" turn up anything. > > Would someone be willing to do some investigation into whether such a > command is implemented in the protocol, and what it would take to get a "xm > block-resize" command working? (Not necessarily do it, but have an idea > what probably needs to be done.) Have a look at http://xenbits.xen.org/hg/linux-2.6.18-xen.hg/rev/f7f420bd7b7a - I don't think there is a strict need for xm/xl commands, except as a courtesy. Jan From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: Resizing block devices live? Date: Tue, 18 Dec 2012 09:37:56 -0500 Message-ID: <20121218143756.GA24713@phenom.dumpdata.com> References: <1355839087.14620.219.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: "xen-devel@lists.xen.org" , Ian Campbell , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org On Tue, Dec 18, 2012 at 02:06:56PM +0000, George Dunlap wrote: > On Tue, Dec 18, 2012 at 1:58 PM, Ian Campbell wrote: > > > On Tue, 2012-12-18 at 13:52 +0000, George Dunlap wrote: > > > One of the requests from the xenorg.uservoice.com page that had a > > > moderate amount of interest was to allow block devices to be resized. > > > There's a description here: > > > > > > > > https://xenorg.uservoice.com/forums/172169-xen-development/suggestions/3140313-implement-block-device-resize > > > > > > > > > I have no idea what this would take -- can anyone comment? > > > > Doesn't that already work? I thought this was patch in the PV block > > drivers ages ago... > > > > Yes, http://wiki.xen.org/wiki/XenParavirtOps lists it under 2.6.36. > > > > Maybe this is a missing feature of (lib)xl vs xend? > > > > "xm help" doesn't show a "block-resize" command, nor does grepping through > tools for "resize" turn up anything. > > Would someone be willing to do some investigation into whether such a > command is implemented in the protocol, and what it would take to get a "xm > block-resize" command working? (Not necessarily do it, but have an idea > what probably needs to be done.) Looking at the history it looks to be: 1fa73be6be65028a7543bba8f14474b42e064a1b which is commit 1fa73be6be65028a7543bba8f14474b42e064a1b Author: K. Y. Srinivasan Date: Thu Mar 11 13:42:26 2010 -0800 xen/front: Propagate changed size of VBDs Support dynamic resizing of virtual block devices. This patch supports both file backed block devices as well as physical devices that can be dynamically resized on the host side. Signed-off-by: K. Y. Srinivasan Signed-off-by: Jeremy Fitzhardinge diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 60006b7..f47b096 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -930,9 +930,24 @@ static void blkfront_connect(struct blkfront_info *info) unsigned int binfo; int err; - if ((info->connected == BLKIF_STATE_CONNECTED) || - (info->connected == BLKIF_STATE_SUSPENDED) ) + switch (info->connected) { + case BLKIF_STATE_CONNECTED: + /* + * Potentially, the back-end may be signalling + * a capacity change; update the capacity. + */ + err = xenbus_scanf(XBT_NIL, info->xbdev->otherend, + "sectors", "%Lu", §ors); + if (XENBUS_EXIST_ERR(err)) + return; + printk(KERN_INFO "Setting capacity to %Lu\n", + sectors); + set_capacity(info->gd, sectors); + + /* fall through */ + case BLKIF_STATE_SUSPENDED: return; + } dev_dbg(&info->xbdev->dev, "%s:%s.\n", __func__, info->xbdev->otherend); So it should be altering the 'sectors' value and just writting the backend state from XenbusStateConnected to XenbusStateConnected. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: Resizing block devices live? Date: Tue, 18 Dec 2012 14:43:19 +0000 Message-ID: <1355841799.14620.244.camel@zakaz.uk.xensource.com> References: <1355839087.14620.219.camel@zakaz.uk.xensource.com> <20121218143756.GA24713@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20121218143756.GA24713@phenom.dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk Cc: George Dunlap , "xen-devel@lists.xen.org" , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org On Tue, 2012-12-18 at 14:37 +0000, Konrad Rzeszutek Wilk wrote: > > So it should be altering the 'sectors' value and just writting > the backend state from XenbusStateConnected to XenbusStateConnected. I wonder if anyone fancies patching xen/include/public/io/blkif.h to say so. Ian. From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: Resizing block devices live? Date: Tue, 18 Dec 2012 14:51:30 +0000 Message-ID: <50D0910202000078000B1171@nat28.tlf.novell.com> References: <1355839087.14620.219.camel@zakaz.uk.xensource.com> <20121218143756.GA24713@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20121218143756.GA24713@phenom.dumpdata.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap , Konrad Rzeszutek Wilk Cc: "xen-devel@lists.xen.org" , Ian Campbell , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org >>> On 18.12.12 at 15:37, Konrad Rzeszutek Wilk wrote: > So it should be altering the 'sectors' value and just writting > the backend state from XenbusStateConnected to XenbusStateConnected. Which is what the corresponding backend patch does (which for upstream was separate because I think blkback wasn't upstream yet back when KY did that work). Jan From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: Resizing block devices live? Date: Tue, 18 Dec 2012 15:50:01 +0000 Message-ID: References: <1355839087.14620.219.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7426101174037856555==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --===============7426101174037856555== Content-Type: multipart/alternative; boundary=20cf3071c76e59dbc804d12273bf --20cf3071c76e59dbc804d12273bf Content-Type: text/plain; charset=ISO-8859-1 Oops, somehow forgot to cc the list here... On Tue, Dec 18, 2012 at 2:13 PM, George Dunlap wrote: > On Tue, Dec 18, 2012 at 2:06 PM, George Dunlap < > George.Dunlap@eu.citrix.com> wrote: > >> "xm help" doesn't show a "block-resize" command, nor does grepping >> through tools for "resize" turn up anything. >> > > According to the guy who submitted the patch that was accepted into > 2.6.36: "My goal was to not have the end-user do anything other than what > was minimally required to resizing the device on the host side. Once the > device is resized on the host side, this capacity change is propagated to > the guest without having to invoke any xm command." > > So in theory this should already work. > > I've asked the guy who submitted the request to test it. > > -George > --20cf3071c76e59dbc804d12273bf Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Oops, somehow forgot to cc the list here...


On Tue, Dec 18, 20= 12 at 2:13 PM, George Dunlap <George.Dunlap@eu.citrix.com>= ; wrote:
On Tue, D= ec 18, 2012 at 2:06 PM, George Dunlap <George.Dunlap@eu.citrix.c= om> wrote:
"xm= help" doesn't show a "block-resize" command, nor does g= repping through tools for "resize" turn up anything.

According to the guy who submi= tted the patch that was accepted into 2.6.36:=A0 "My goal was to not h= ave the end-user do anything other than what was minimally required to =A0<= span>resizing the device on the host side. Once the device is resized on the host side, this capacity ch= ange is propagated to the guest without having to invoke any xm command.&qu= ot;

So in theory this should already work.=A0

I've a= sked the guy who submitted the request to test it.

=A0-George

--20cf3071c76e59dbc804d12273bf-- --===============7426101174037856555== 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.xen.org http://lists.xen.org/xen-devel --===============7426101174037856555==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: Resizing block devices live? Date: Tue, 18 Dec 2012 15:58:16 +0000 Message-ID: <1355846296.14620.260.camel@zakaz.uk.xensource.com> References: <1355839087.14620.219.camel@zakaz.uk.xensource.com> <20121218143756.GA24713@phenom.dumpdata.com> <50D0910202000078000B1171@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <50D0910202000078000B1171@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: George Dunlap , Roger Pau Monne , "xen-devel@lists.xen.org" , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On Tue, 2012-12-18 at 14:51 +0000, Jan Beulich wrote: > >>> On 18.12.12 at 15:37, Konrad Rzeszutek Wilk wrote: > > So it should be altering the 'sectors' value and just writting > > the backend state from XenbusStateConnected to XenbusStateConnected. > > Which is what the corresponding backend patch does (which for > upstream was separate because I think blkback wasn't upstream > yet back when KY did that work). Looks like this was upstream, in the first version of the patch from the looks of things. I suspect it wasn't usable until 496b318eb655 which fixed a xenbus hang on the second resize but that was in v3.0-rc1 so it ought to be ok... Ian. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= Subject: Re: Resizing block devices live? Date: Tue, 18 Dec 2012 22:23:35 +0200 Message-ID: <20121218202335.GM8912@reaktio.net> References: <1355839087.14620.219.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: George Dunlap Cc: Roger Pau Monne , "xen-devel@lists.xen.org" , Ian Campbell , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org On Tue, Dec 18, 2012 at 02:06:56PM +0000, George Dunlap wrote: > On Tue, Dec 18, 2012 at 1:58 PM, Ian Campbell <[1]Ian.Campbell@citrix.com> > wrote: > > On Tue, 2012-12-18 at 13:52 +0000, George Dunlap wrote: > > One of the requests from the [2]xenorg.uservoice.com page that had a > > moderate amount of interest was to allow block devices to be resized. > > There's a description here: > > > > > [3]https://xenorg.uservoice.com/forums/172169-xen-development/suggestions/3140313-implement-block-device-resize > > > > > > I have no idea what this would take -- can anyone comment? > > Doesn't that already work? I thought this was patch in the PV block > drivers ages ago... > > Yes, [4]http://wiki.xen.org/wiki/XenParavirtOps lists it under 2.6.36. > > Maybe this is a missing feature of (lib)xl vs xend? > > "xm help" doesn't show a "block-resize" command, nor does grepping through > tools for "resize" turn up anything. > > Would someone be willing to do some investigation into whether such a > command is implemented in the protocol, and what it would take to get a > "xm block-resize" command working? (Not necessarily do it, but have an > idea what probably needs to be done.) > Resizing is supported automatically if running new enough blkback and blkfront! Resize the backing LVM volume in dom0 and the domU will notice the disk has been resized. There has been discussion (and patches) on xen-devel a couple of years ago. -- Pasi