<div>Hi all,</div><div><br></div><div>I'm implementing scale-in features in OpenNebula like live memory growth/shrinking and vcpus hotplugging/hotunplugging.</div><div><br></div><div>You can see my git there: <a href="http://paulg.fr/gitweb/?p=one.git;a=summary;js=1">http://paulg.fr/gitweb/?p=one.git;a=summary;js=1</a></div>

<div>My developement branch is feature-scalein. It's still very much a WIP most of the interesting code is there and basic features are functionnal on Xen at the moment.</div><div>My dev branch is based on one-3.2 but can easily be rebased on master.</div>

<div><br></div><div>Everything is meant to eventualy hit upstream, that why I'd like to get some advices and feedback from you.</div><div><br></div><div>Here are my questions:</div><div><br></div><div>1. About VM memory scaling: Currently, AFAIK the vm.memory is used when deploying a VM to set it's initial memory and then is regularly updated via hypervisor polling.</div>

<div>    ATM, i'm also using this attribute to change memory size. I think it's really not the best way thing to do. I'd like to separate theses different things in separate variables.</div><div>    For exemple:</div>

<div>       -memory: the same as of now.</div><div>       -memory_target: the target amount of memory when scaling memory.</div><div><br></div><div>    I could also use VM history but I'm not very familiar with this class.</div>

<div><br></div><div>2. When scalling the number of VCPUs, should we also scale the VM's cpu share? If so, how to implement it?</div><div><br></div><div>3. In the case of a scalling failure (memory or vcpu), what should we do?</div>

<div>   -Consider the VM failed and not usable anymore? (I think it's way too strict)</div><div>   -Consider the VM still ACTIVE. However, how to inform the user about the failure (something else than writing in logs).</div>

<div>    And then what should we do?</div><div>       -immediatly throw a monitor request to update to the correct value?</div><div>       -Consider the worst case: if scaling down the memory => consider the old value/ if scaling up the memory, consider the new value</div>

<div>       -Other ideas?</div><div><br></div><div>Any suggestions about the code structure, writing style, naming conventions, whatever... are welcome :D</div><div><br></div><div>You can also see my TODO list here: <a href="http://paulg.fr/gitweb/?p=one.git;a=blob_plain;f=TODO;h=79c65a4a6eba19095a43191a75fc1e5d58d7e01a;hb=refs/heads/feature-scalein;js=1">http://paulg.fr/gitweb/?p=one.git;a=blob_plain;f=TODO;h=79c65a4a6eba19095a43191a75fc1e5d58d7e01a;hb=refs/heads/feature-scalein;js=1</a></div>

<div><br></div><div>What changed:</div><div><font face="'courier new', monospace">paulg@debian-pro:~/projects/one$ git diff one-3.2 --stat</font></div><div><font face="'courier new', monospace"> TODO                                      |   12 ++</font></div>

<div><font face="'courier new', monospace"> include/DispatchManager.h                 |   20 +++</font></div><div><font face="'courier new', monospace"> include/LifeCycleManager.h                |   20 +++-</font></div>

<div><font face="'courier new', monospace"> include/RequestManagerVirtualMachine.h    |   36 +++++</font></div><div><font face="'courier new', monospace"> include/VirtualMachine.h                  |   43 +++++-</font></div>

<div><font face="'courier new', monospace"> include/VirtualMachineManager.h           |   50 +++++--</font></div><div><font face="'courier new', monospace"> include/VirtualMachineManagerDriver.h     |   50 +++++--</font></div>

<div><font face="'courier new', monospace"> install.sh                                |    4 +-</font></div><div><font face="'courier new', monospace"> share/man/onevm.1                         |   60 ++++++++</font></div>

<div><font face="'courier new', monospace"> src/cli/one_helper.rb                     |    2 +-</font></div><div><font face="'courier new', monospace"> src/cli/one_helper/onevm_helper.rb        |   24 +++</font></div>

<div><font face="'courier new', monospace"> src/cli/onevm                             |   32 ++++</font></div><div><font face="'courier new', monospace"> src/dm/DispatchManagerActions.cc          |   90 +++++++++++</font></div>

<div><font face="'courier new', monospace"> src/lcm/LifeCycleActions.cc               |   68 +++++++++-</font></div><div><font face="'courier new', monospace"> src/lcm/LifeCycleManager.cc               |   48 ++++++</font></div>

<div><font face="'courier new', monospace"> src/lcm/LifeCycleStates.cc                |  123 +++++++++++++++</font></div><div><font face="'courier new', monospace"> src/mad/ruby/VirtualMachineDriver.rb      |   56 +++++--</font></div>

<div><font face="'courier new', monospace"> src/oca/ruby/OpenNebula/VirtualMachine.rb |   27 +++-</font></div><div><font face="'courier new', monospace"> src/rm/RequestManager.cc                  |    4 +</font></div>

<div><font face="'courier new', monospace"> src/rm/RequestManagerVirtualMachine.cc    |  105 +++++++++++++-</font></div><div><font face="'courier new', monospace"> src/vm/VirtualMachine.cc                  |    3 +</font></div>

<div><font face="'courier new', monospace"> src/vmm/VirtualMachineManager.cc          |  231 +++++++++++++++++++++++++++--</font></div><div><font face="'courier new', monospace"> src/vmm/VirtualMachineManagerDriver.cc    |   72 +++++++++-</font></div>

<div><font face="'courier new', monospace"> src/vmm_mad/dummy/one_vmm_dummy.rb        |    8 +</font></div><div><font face="'courier new', monospace"> src/vmm_mad/exec/one_vmm_exec.rb          |   42 +++++-</font></div>

<div><font face="'courier new', monospace"> src/vmm_mad/exec/one_vmm_sh               |    2 +-</font></div><div><font face="'courier new', monospace"> src/vmm_mad/remotes/xen/scale_memory      |   26 ++++</font></div>

<div><font face="'courier new', monospace"> src/vmm_mad/remotes/xen/scale_vcpu        |   26 ++++</font></div><div><font face="'courier new', monospace"> src/vmm_mad/remotes/xen/xenrc             |    3 +-</font></div>

<div><font face="'courier new', monospace"> 29 files changed, 1204 insertions(+), 83 deletions(-)</font></div><div><br></div><div>Thank for your help,</div><div><br></div><div>Paul Grandperrin</div>