All of lore.kernel.org
 help / color / mirror / Atom feed
* Strange (???) xl behavior for save, migrate and migrate-receive
@ 2011-10-17 17:40 Daniel Kiper
  2011-10-17 18:44 ` Dan Magenheimer
  2011-10-17 19:12 ` Olaf Hering
  0 siblings, 2 replies; 10+ messages in thread
From: Daniel Kiper @ 2011-10-17 17:40 UTC (permalink / raw)
  To: xen-devel, konrad.wilk, ian.jackson, ian.campbell, jeremy,
	v.tolstov

Hi,

During work on memory hotplug for Xen I have received some notices
that it breaks machine migration. I had some time and I done some
tests a few days ago. It looks that source of this problem is
xl command itself. I discovered that generic save/restore mechanism
is used for machine migration. xl save store machine config which
was used at machine startup with current machine state. It means
that it does not take into account any config changes which were made
during machine run. This behavior does not allow migrating domain,
on which memory hotplug was used, to restore on destination host
because current size of memory allocated for machine is larger than
size of memory allocated at startup by memory option. Yes, it is
memory option not maxmem option. However, it is not important here
because I think that generic behavior of xl save, migrate and migrate-receive
should be changed (fix for memory hotplug case is workaround for the
generic problem which will return sooner or later). I think that xl save,
migrate and migrate-receive should use current machine state and __CURRENT__
config (from xenstore ???) to do their tasks. However, I am aware that
this change could have large impact on current users. That is why I decided
to ask you about your opinion and suggested solutions in that case
(in general not memory hotplug only).

Currently, these problems could be workaround by passing
path to config file with current config to xl command.

I have done tests on Xen Ver. 4.1.2-rc3. I have not done tests
on xm command, however, I suppose that it has similar behavior.

Daniel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Strange (???) xl behavior for save, migrate and migrate-receive
  2011-10-17 17:40 Strange (???) xl behavior for save, migrate and migrate-receive Daniel Kiper
@ 2011-10-17 18:44 ` Dan Magenheimer
  2011-10-18  8:19   ` Ian Campbell
  2011-10-18 15:22   ` Daniel Kiper
  2011-10-17 19:12 ` Olaf Hering
  1 sibling, 2 replies; 10+ messages in thread
From: Dan Magenheimer @ 2011-10-17 18:44 UTC (permalink / raw)
  To: Daniel Kiper, xen-devel, Konrad Wilk, ian.jackson, ian.campbell,
	jeremy, v.tolst

> From: Daniel Kiper [mailto:dkiper@net-space.pl]
> Subject: [Xen-devel] Strange (???) xl behavior for save, migrate and migrate-receive
> 
> During work on memory hotplug for Xen I have received some notices
> that it breaks machine migration. I had some time and I done some
> tests a few days ago. It looks that source of this problem is
> xl command itself. I discovered that generic save/restore mechanism
> is used for machine migration. xl save store machine config which
> was used at machine startup with current machine state. It means
> that it does not take into account any config changes which were made
> during machine run. This behavior does not allow migrating domain,
> on which memory hotplug was used, to restore on destination host
> because current size of memory allocated for machine is larger than
> size of memory allocated at startup by memory option. Yes, it is
> memory option not maxmem option. However, it is not important here
> because I think that generic behavior of xl save, migrate and migrate-receive
> should be changed (fix for memory hotplug case is workaround for the
> generic problem which will return sooner or later). I think that xl save,
> migrate and migrate-receive should use current machine state and __CURRENT__
> config (from xenstore ???) to do their tasks. However, I am aware that
> this change could have large impact on current users. That is why I decided
> to ask you about your opinion and suggested solutions in that case
> (in general not memory hotplug only).
> 
> Currently, these problems could be workaround by passing
> path to config file with current config to xl command.
> 
> I have done tests on Xen Ver. 4.1.2-rc3. I have not done tests
> on xm command, however, I suppose that it has similar behavior.

Hi Daniel --

In a recent internal discussion at Oracle, we were thinking about
whether to enable hotplug functionality in a guest kernel and it
raised some concerns about manageability.  I think right now
the system administrator of the guest can arbitrarily increase
memory size beyond maxmem... that is really the whole point
of your implementation, right?  But this may be unacceptable to
the "data center administrator" (the admin who runs the "cloud"
and determines such things as vcpus and maxmem across all guests)
since multiple guests may try to do this semi-maliciously to grab
as much RAM as they can. And Xen has no way to discourage this,
so will just hand out the RAM first-come-first-serve, right?

I was thinking one way to handle this problem would be
to have a new vm.cfg parameter, e.g. "maxmem_hotplug".
If unspecified (or zero), there are no constraints placed
on the guest.  If specified (in MB), Xen/xl will disallow
hotplug memory requests beyond this maximum.

I suspect, if implemented properly, this might also eliminate
your live migration issue.

Apologies if something like this was previously discussed or
is already working in your implementation.

Dan

P.S. Also FYI, selfballooning is implemented in Oracle's kernel
so we should work to ensure that selfballooning and hotplug
work properly together.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange (???) xl behavior for save, migrate and migrate-receive
  2011-10-17 17:40 Strange (???) xl behavior for save, migrate and migrate-receive Daniel Kiper
  2011-10-17 18:44 ` Dan Magenheimer
@ 2011-10-17 19:12 ` Olaf Hering
  2011-10-18 15:32   ` Daniel Kiper
  1 sibling, 1 reply; 10+ messages in thread
From: Olaf Hering @ 2011-10-17 19:12 UTC (permalink / raw)
  To: Daniel Kiper
  Cc: jeremy, xen-devel, konrad.wilk, ian.jackson, v.tolstov,
	ian.campbell

On Mon, Oct 17, Daniel Kiper wrote:

> During work on memory hotplug for Xen I have received some notices
> that it breaks machine migration. I had some time and I done some
> tests a few days ago. It looks that source of this problem is
> xl command itself. I discovered that generic save/restore mechanism
> is used for machine migration. xl save store machine config which
> was used at machine startup with current machine state. It means
> that it does not take into account any config changes which were made
> during machine run. This behavior does not allow migrating domain,
> on which memory hotplug was used, to restore on destination host
> because current size of memory allocated for machine is larger than
> size of memory allocated at startup by memory option. Yes, it is
> memory option not maxmem option. However, it is not important here
> because I think that generic behavior of xl save, migrate and migrate-receive
> should be changed (fix for memory hotplug case is workaround for the
> generic problem which will return sooner or later). I think that xl save,
> migrate and migrate-receive should use current machine state and __CURRENT__
> config (from xenstore ???) to do their tasks. However, I am aware that
> this change could have large impact on current users. That is why I decided
> to ask you about your opinion and suggested solutions in that case
> (in general not memory hotplug only).

Its easy to implement in xl by throwing some xenstore watches into the
code.

http://lists.xensource.com/archives/html/xen-devel/2011-10/msg00778.html

Olaf

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Strange (???) xl behavior for save, migrate and migrate-receive
  2011-10-17 18:44 ` Dan Magenheimer
@ 2011-10-18  8:19   ` Ian Campbell
  2011-10-18 15:16     ` Daniel Kiper
  2011-10-18 15:22   ` Daniel Kiper
  1 sibling, 1 reply; 10+ messages in thread
From: Ian Campbell @ 2011-10-18  8:19 UTC (permalink / raw)
  To: Dan Magenheimer
  Cc: jeremy@goop.org, xen-devel@lists.xensource.com, Konrad Wilk,
	Ian Jackson, v.tolstov@selfip.ru, Daniel Kiper

On Mon, 2011-10-17 at 19:44 +0100, Dan Magenheimer wrote:
> In a recent internal discussion at Oracle, we were thinking about
> whether to enable hotplug functionality in a guest kernel and it
> raised some concerns about manageability.  I think right now
> the system administrator of the guest can arbitrarily increase
> memory size beyond maxmem...

The memory limit for a guest is ultimately controlled by the host
administrator/toolstack. The in-guest admin cannot exceed that, even
using hotplug. I think that limit is currently always set to the current
balloon target.

AIUI Daniel's work only allows a guest admin to take advantage of new
memory above maxmem _after_ the host admin has provisioned that RAM to
the guest. IOW it only allows the guest to take advantage of new memory
given to it and does not allow the guest to acquire new memory of its
own accord.

Ian.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange (???) xl behavior for save, migrate and migrate-receive
  2011-10-18  8:19   ` Ian Campbell
@ 2011-10-18 15:16     ` Daniel Kiper
  2011-10-18 17:58       ` Dan Magenheimer
  2011-11-02 14:17       ` Vasiliy Tolstov
  0 siblings, 2 replies; 10+ messages in thread
From: Daniel Kiper @ 2011-10-18 15:16 UTC (permalink / raw)
  To: Ian Campbell
  Cc: Dan Magenheimer, xen-devel@lists.xensource.com, Konrad Wilk,
	Ian Jackson, jeremy@goop.org, v.tolstov@selfip.ru, Daniel Kiper

On Tue, Oct 18, 2011 at 09:19:01AM +0100, Ian Campbell wrote:
> On Mon, 2011-10-17 at 19:44 +0100, Dan Magenheimer wrote:
> > In a recent internal discussion at Oracle, we were thinking about
> > whether to enable hotplug functionality in a guest kernel and it
> > raised some concerns about manageability.  I think right now
> > the system administrator of the guest can arbitrarily increase
> > memory size beyond maxmem...
>
> The memory limit for a guest is ultimately controlled by the host
> administrator/toolstack. The in-guest admin cannot exceed that, even
> using hotplug.

Correct.

> I think that limit is currently always set to the current balloon target.

Nope. It is set by maxmem option.

> AIUI Daniel's work only allows a guest admin to take advantage of new
> memory above maxmem _after_ the host admin has provisioned that RAM to
> the guest. IOW it only allows the guest to take advantage of new memory
> given to it and does not allow the guest to acquire new memory of its
> own accord.

Guest/host administartor could allocate for given guest no more memory than
maxmem (its value could be changed by xl mem-max <domain> <new_size>) allows,
regardless of mechanism (ballooning or memory hotplug) used for that allocation.
It means that memory hotplug does not pose any security threat in that area.

Daniel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange (???) xl behavior for save, migrate and migrate-receive
  2011-10-17 18:44 ` Dan Magenheimer
  2011-10-18  8:19   ` Ian Campbell
@ 2011-10-18 15:22   ` Daniel Kiper
  1 sibling, 0 replies; 10+ messages in thread
From: Daniel Kiper @ 2011-10-18 15:22 UTC (permalink / raw)
  To: Dan Magenheimer
  Cc: jeremy, xen-devel, Konrad Wilk, ian.jackson, v.tolstov,
	ian.campbell, Daniel Kiper

On Mon, Oct 17, 2011 at 11:44:51AM -0700, Dan Magenheimer wrote:
> > From: Daniel Kiper [mailto:dkiper@net-space.pl]
> > Subject: [Xen-devel] Strange (???) xl behavior for save, migrate and migrate-receive
> >
> > During work on memory hotplug for Xen I have received some notices
> > that it breaks machine migration. I had some time and I done some
> > tests a few days ago. It looks that source of this problem is
> > xl command itself. I discovered that generic save/restore mechanism
> > is used for machine migration. xl save store machine config which
> > was used at machine startup with current machine state. It means
> > that it does not take into account any config changes which were made
> > during machine run. This behavior does not allow migrating domain,
> > on which memory hotplug was used, to restore on destination host
> > because current size of memory allocated for machine is larger than
> > size of memory allocated at startup by memory option. Yes, it is
> > memory option not maxmem option. However, it is not important here
> > because I think that generic behavior of xl save, migrate and migrate-receive
> > should be changed (fix for memory hotplug case is workaround for the
> > generic problem which will return sooner or later). I think that xl save,
> > migrate and migrate-receive should use current machine state and __CURRENT__
> > config (from xenstore ???) to do their tasks. However, I am aware that
> > this change could have large impact on current users. That is why I decided
> > to ask you about your opinion and suggested solutions in that case
> > (in general not memory hotplug only).
> >
> > Currently, these problems could be workaround by passing
> > path to config file with current config to xl command.
> >
> > I have done tests on Xen Ver. 4.1.2-rc3. I have not done tests
> > on xm command, however, I suppose that it has similar behavior.
>
> Hi Daniel --
>
> In a recent internal discussion at Oracle, we were thinking about
> whether to enable hotplug functionality in a guest kernel and it
> raised some concerns about manageability.  I think right now
> the system administrator of the guest can arbitrarily increase
> memory size beyond maxmem... that is really the whole point
> of your implementation, right?  But this may be unacceptable to
> the "data center administrator" (the admin who runs the "cloud"
> and determines such things as vcpus and maxmem across all guests)
> since multiple guests may try to do this semi-maliciously to grab
> as much RAM as they can. And Xen has no way to discourage this,
> so will just hand out the RAM first-come-first-serve, right?
>
> I was thinking one way to handle this problem would be
> to have a new vm.cfg parameter, e.g. "maxmem_hotplug".
> If unspecified (or zero), there are no constraints placed
> on the guest.  If specified (in MB), Xen/xl will disallow
> hotplug memory requests beyond this maximum.
>
> I suspect, if implemented properly, this might also eliminate
> your live migration issue.
>
> Apologies if something like this was previously discussed or
> is already working in your implementation.

Please look into Ian and my e-mail posted earlier.

> Dan
>
> P.S. Also FYI, selfballooning is implemented in Oracle's kernel
> so we should work to ensure that selfballooning and hotplug
> work properly together.

I am happy to do that, however, I am very busy now.
Could we postpone this 2-3 months ???

Daniel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange (???) xl behavior for save, migrate and migrate-receive
  2011-10-17 19:12 ` Olaf Hering
@ 2011-10-18 15:32   ` Daniel Kiper
  0 siblings, 0 replies; 10+ messages in thread
From: Daniel Kiper @ 2011-10-18 15:32 UTC (permalink / raw)
  To: Olaf Hering
  Cc: jeremy, xen-devel, konrad.wilk, ian.jackson, v.tolstov,
	ian.campbell, Daniel Kiper

On Mon, Oct 17, 2011 at 09:12:05PM +0200, Olaf Hering wrote:
> On Mon, Oct 17, Daniel Kiper wrote:
>
> > During work on memory hotplug for Xen I have received some notices
> > that it breaks machine migration. I had some time and I done some
> > tests a few days ago. It looks that source of this problem is
> > xl command itself. I discovered that generic save/restore mechanism
> > is used for machine migration. xl save store machine config which
> > was used at machine startup with current machine state. It means
> > that it does not take into account any config changes which were made
> > during machine run. This behavior does not allow migrating domain,
> > on which memory hotplug was used, to restore on destination host
> > because current size of memory allocated for machine is larger than
> > size of memory allocated at startup by memory option. Yes, it is
> > memory option not maxmem option. However, it is not important here
> > because I think that generic behavior of xl save, migrate and migrate-receive
> > should be changed (fix for memory hotplug case is workaround for the
> > generic problem which will return sooner or later). I think that xl save,
> > migrate and migrate-receive should use current machine state and __CURRENT__
> > config (from xenstore ???) to do their tasks. However, I am aware that
> > this change could have large impact on current users. That is why I decided
> > to ask you about your opinion and suggested solutions in that case
> > (in general not memory hotplug only).
>
> Its easy to implement in xl by throwing some xenstore watches into the
> code.
>
> http://lists.xensource.com/archives/html/xen-devel/2011-10/msg00778.html

Thanks. I saw your e-mail eariler, however, I decided to post my one
separetly because it is a bit different case. As you said implementation
is probably easy. However, I do not want break default behavior of
xl without consent with Xen-devel members.

Daniel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Strange (???) xl behavior for save, migrate and migrate-receive
  2011-10-18 15:16     ` Daniel Kiper
@ 2011-10-18 17:58       ` Dan Magenheimer
  2011-11-02 14:17       ` Vasiliy Tolstov
  1 sibling, 0 replies; 10+ messages in thread
From: Dan Magenheimer @ 2011-10-18 17:58 UTC (permalink / raw)
  To: Daniel Kiper, Ian Campbell
  Cc: jeremy, Ian, Konrad Wilk, Jackson, v.tolstov, xen-devel

> From: Daniel Kiper [mailto:dkiper@net-space.pl]
> Subject: Re: [Xen-devel] Strange (???) xl behavior for save, migrate and migrate-receive
> 
> On Tue, Oct 18, 2011 at 09:19:01AM +0100, Ian Campbell wrote:
> > On Mon, 2011-10-17 at 19:44 +0100, Dan Magenheimer wrote:
> > > In a recent internal discussion at Oracle, we were thinking about
> > > whether to enable hotplug functionality in a guest kernel and it
> > > raised some concerns about manageability.  I think right now
> > > the system administrator of the guest can arbitrarily increase
> > > memory size beyond maxmem...
> >
> > The memory limit for a guest is ultimately controlled by the host
> > administrator/toolstack. The in-guest admin cannot exceed that, even
> > using hotplug.
> 
> Correct.
> 
> > I think that limit is currently always set to the current balloon target.
> 
> Nope. It is set by maxmem option.
> 
> > AIUI Daniel's work only allows a guest admin to take advantage of new
> > memory above maxmem _after_ the host admin has provisioned that RAM to
> > the guest. IOW it only allows the guest to take advantage of new memory
> > given to it and does not allow the guest to acquire new memory of its
> > own accord.
> 
> Guest/host administartor could allocate for given guest no more memory than
> maxmem (its value could be changed by xl mem-max <domain> <new_size>) allows,
> regardless of mechanism (ballooning or memory hotplug) used for that allocation.
> It means that memory hotplug does not pose any security threat in that area.

OK, thanks for the clarification, Daniel and Ian.

> > P.S. Also FYI, selfballooning is implemented in Oracle's kernel
> > so we should work to ensure that selfballooning and hotplug
> > work properly together.
> 
> I am happy to do that, however, I am very busy now.
> Could we postpone this 2-3 months ???

Sure, that's fine.

Dan

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange (???) xl behavior for save, migrate and migrate-receive
  2011-10-18 15:16     ` Daniel Kiper
  2011-10-18 17:58       ` Dan Magenheimer
@ 2011-11-02 14:17       ` Vasiliy Tolstov
  2011-11-02 20:33         ` Daniel Kiper
  1 sibling, 1 reply; 10+ messages in thread
From: Vasiliy Tolstov @ 2011-11-02 14:17 UTC (permalink / raw)
  To: Daniel Kiper
  Cc: Dan Magenheimer, xen-devel@lists.xensource.com, Ian Campbell,
	Konrad Wilk, Ian Jackson, jeremy@goop.org


[-- Attachment #1.1: Type: text/plain, Size: 706 bytes --]

2011/10/18 Daniel Kiper <dkiper@net-space.pl>

> Guest/host administartor could allocate for given guest no more memory
> than
> maxmem (its value could be changed by xl mem-max <domain> <new_size>)
> allows,
> regardless of mechanism (ballooning or memory hotplug) used for that
> allocation.
> It means that memory hotplug does not pose any security threat in that
> area.
>

Sorry for bumping thread. Does this mean, that if i use memory=512,
maxmem=4096 grows via balloon to 4096, after that set maxmem to 8192 and
grows guest to 7000mb and do live migration - nothing bad happening and
guest migrate process successed?

-- 
Vasiliy Tolstov,
Clodo.ru
e-mail: v.tolstov@selfip.ru
jabber: vase@selfip.ru

[-- Attachment #1.2: Type: text/html, Size: 1363 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Strange (???) xl behavior for save, migrate and migrate-receive
  2011-11-02 14:17       ` Vasiliy Tolstov
@ 2011-11-02 20:33         ` Daniel Kiper
  0 siblings, 0 replies; 10+ messages in thread
From: Daniel Kiper @ 2011-11-02 20:33 UTC (permalink / raw)
  To: Vasiliy Tolstov
  Cc: Dan Magenheimer, xen-devel@lists.xensource.com, Ian Campbell,
	Konrad Wilk, Ian Jackson, jeremy@goop.org, Daniel Kiper

On Wed, Nov 02, 2011 at 06:17:38PM +0400, Vasiliy Tolstov wrote:
> 2011/10/18 Daniel Kiper <dkiper@net-space.pl>
>
> > Guest/host administartor could allocate for given guest no more memory than
> > maxmem (its value could be changed by xl mem-max <domain> <new_size>) allows,
> > regardless of mechanism (ballooning or memory hotplug) used for that allocation.
> > It means that memory hotplug does not pose any security threat in that
> > area.
>
> Sorry for bumping thread. Does this mean, that if i use memory=512,
> maxmem=4096 grows via balloon to 4096, after that set maxmem to 8192 and
> grows guest to 7000mb and do live migration - nothing bad happening and
> guest migrate process successed?

Yep, however, now you must use workaround for xl (which was described)
earlier in this thread. I have idea how to fix xl but I do not have
time to do it. I am going to do that next year.

Daniel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-11-02 20:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-17 17:40 Strange (???) xl behavior for save, migrate and migrate-receive Daniel Kiper
2011-10-17 18:44 ` Dan Magenheimer
2011-10-18  8:19   ` Ian Campbell
2011-10-18 15:16     ` Daniel Kiper
2011-10-18 17:58       ` Dan Magenheimer
2011-11-02 14:17       ` Vasiliy Tolstov
2011-11-02 20:33         ` Daniel Kiper
2011-10-18 15:22   ` Daniel Kiper
2011-10-17 19:12 ` Olaf Hering
2011-10-18 15:32   ` Daniel Kiper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.