ok, i signed the cla online but have not received anything from google yet.

however here is the small patch. i'm not sure if i should use HV_MAXMEM or BE_MAXMEM for this but it works for me. also there is no check if maxmem > memory while running "gtn-instance modify -H maxmem=123" but you get an error (from xen) while starting the instances if you set maxmem > memory:

Error: memory_dynamic_max must be less than or equal to memory_static_max

if i need to change the patch for inclusion i'll give my best. :)

regards
heiko

On Wed, 2 Mar 2011 16:13:10 +0100, Iustin Pop <[email protected]> wrote:
On Wed, Mar 02, 2011 at 04:06:16PM +0100, Heiko Baumann wrote:
thanks for the fast reply.

what exactly does "break" mean? does this affect the N+1 mem
calculation stuff?

Yep. It's not real breakage, hence the quotes. Also, Ganeti won't be
able to check other things (placement using the IAllocator framework
will not be correct, but if you don't use it it's OK).

a few minutes ago i've hacked constrants.py and hv_xen.py a little
bit to allow setting of maxmem via gnt-cluster modify -B
maxmem="123" and gnt-instance modify... and it works. :) however i
guess this is just a ugly hack because of my !coding skills ;)

If you fill in the contributor license agreement (see the wiki for
Developer Guidelines; sorry for this requirement) you can send the patch
for inclusion - it doesn't have to be perfect, so don't worry!

is this the right place for the request? ->
http://code.google.com/p/ganeti/issues/list

Yep!

thanks,
iustin

On Wed, 2 Mar 2011 15:55:06 +0100, Iustin Pop <[email protected]>
wrote:
>On Wed, Mar 02, 2011 at 03:34:05PM +0100, Heiko Baumann wrote:
>>hi,
>>
>>is it possible to set maxmem for a xen pv domu via ganeti? without
>>it, its not possible to change mem for a running domu to more than
>>the initial mem="" setting. i havent found anything in the docs.
>
>It is not, as currently it "breaks" Ganeti if you use DRBD instances. >But otherwise it should be fine, could you please file a request for
>this?
>
>thanks,
>iustin

--- lib/constants.py.org        2010-12-20 14:25:23.000000000 +0100
+++ lib/constants.py    2011-03-02 17:05:46.000000000 +0100
@@ -578,6 +578,7 @@
 HV_KVM_USE_CHROOT = "use_chroot"
 HV_CPU_MASK = "cpu_mask"
 HV_MEM_PATH = "mem_path"
+HV_MAXMEM = "maxmem"
 
 HVS_PARAMETER_TYPES = {
   HV_BOOT_ORDER: VTYPE_STRING,
@@ -615,6 +616,7 @@
   HV_KVM_USE_CHROOT: VTYPE_BOOL,
   HV_CPU_MASK: VTYPE_STRING,
   HV_MEM_PATH: VTYPE_STRING,
+  HV_MAXMEM: VTYPE_INT,
   }
 
 HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
@@ -940,6 +942,7 @@
     HV_KERNEL_ARGS: 'ro',
     HV_MIGRATION_PORT: 8002,
     HV_MIGRATION_MODE: HT_MIGRATION_LIVE,
+    HV_MAXMEM: '256',
     },
   HT_XEN_HVM: {
     HV_BOOT_ORDER: "cd",
@@ -955,6 +958,7 @@
     HV_MIGRATION_PORT: 8002,
     HV_MIGRATION_MODE: HT_MIGRATION_NONLIVE,
     HV_USE_LOCALTIME: False,
+    HV_MAXMEM: '256',
     },
   HT_KVM: {
     HV_KERNEL_PATH: "/boot/vmlinuz-2.6-kvmU",
--- lib/hypervisor/hv_xen.py.org        2010-12-20 14:25:23.000000000 +0100
+++ lib/hypervisor/hv_xen.py    2011-03-02 17:19:09.000000000 +0100
@@ -459,6 +459,7 @@
     constants.HV_KERNEL_ARGS: hv_base.NO_CHECK,
     constants.HV_MIGRATION_PORT: hv_base.NET_PORT_CHECK,
     constants.HV_MIGRATION_MODE: hv_base.MIGRATION_MODE_CHECK,
+    constants.HV_MAXMEM: hv_base.NO_CHECK,
     }
 
   @classmethod
@@ -496,6 +497,10 @@
 
     # rest of the settings
     config.write("memory = %d\n" % instance.beparams[constants.BE_MEMORY])
+
+    if hvp[constants.HV_MAXMEM]:
+      config.write("maxmem = '%s'\n" % hvp[constants.HV_MAXMEM])
+
     config.write("vcpus = %d\n" % instance.beparams[constants.BE_VCPUS])
     config.write("name = '%s'\n" % instance.name)
 
@@ -577,6 +582,10 @@
 
     config.write("builder = 'hvm'\n")
     config.write("memory = %d\n" % instance.beparams[constants.BE_MEMORY])
+
+    if hvp[constants.HV_MAXMEM]:
+      config.write("maxmem = '%s'\n" % hvp[constants.HV_MAXMEM])
+
     config.write("vcpus = %d\n" % instance.beparams[constants.BE_VCPUS])
     config.write("name = '%s'\n" % instance.name)
     if hvp[constants.HV_PAE]:

Reply via email to