Hi,<div><br></div><div>Just to answer the initial question from Junix, OpenNebula 3.6 does not support hot-resize of CPU and MEMORY. As described in this thread, this can be achieved somehow by interacting directly with the hypervisor although it may lead to an inconsistent VM state in terms of resouce consumption. </div>
<div><br></div><div> Given the interest show in this thread we will evaluate its implementation for future versions.</div><div><br></div><div>Cheers and thanks for your great feedback!</div><div><br></div><div>Ruben</div>
<div><br><div class="gmail_quote">On Wed, Aug 22, 2012 at 11:06 AM, André Monteiro <span dir="ltr"><<a href="mailto:andre.monteir@gmail.com" target="_blank">andre.monteir@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Hello,</div><div> </div><div>There is a more pratical and fast way:</div><div>- open virt-manager and click for VM details</div><div>- shutdown VM on OpenNebula</div><div>- change RAM and CPU on virt-manager, it will update libvirt xml correctly</div>
<div>- restart machine on OpenNebula</div><div> </div><div>The only catch is that OpenNebula doesn't know about this change and can overcommit resources.<br clear="all"><br>--<br>André Monteiro<br><br><br>
<br><br></div><div class="HOEnZb"><div class="h5"><div class="gmail_quote">On Wed, Aug 22, 2012 at 8:17 AM, cloud.b.lab <span dir="ltr"><<a href="mailto:cloud.b.lab@zoho.com" target="_blank">cloud.b.lab@zoho.com</a>></span> wrote:<br>
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">
<u></u><div><div style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10pt">Junix,<div><br></div><div><b>There is an indirect method</b>, <b>but I do not recommend that as it will send wrong and incorrect signals to OpenNebula Monitoring program and if you do not have fast hands, your VM will end up in "unkn" state.</b></div>
<div><br></div><div>Again I am saying I it is not a recommend practice and you don't try it in a non test environment. </div><div><br></div><div><br></div><div><div style="font-family:verdana,arial,helvetica,sans-serif">
If you would like to try it for information purpose , do the following:</div><div style="font-family:verdana,arial,helvetica,sans-serif"><br></div><div style="font-family:verdana,arial,helvetica,sans-serif">1. Create a test vm and login.</div>
<div style="font-family:verdana,arial,helvetica,sans-serif"> e.g. 153 oneadmin oneadmin centos63 runn 10 <b>1024M</b> onehost 0d 00h12</div><div><div style="font-family:verdana,arial,helvetica,sans-serif">
<br></div><div style="font-family:verdana,arial,helvetica,sans-serif">2. Verify the total memory using "free" command</div><div style="font-family:verdana,arial,helvetica,sans-serif"><br></div></div><div style="font-family:verdana,arial,helvetica,sans-serif">
3. Go to the machine running libvirt [means your OpenNebula Node]</div><div><div style="font-family:verdana,arial,helvetica,sans-serif"><br></div><div style="font-family:verdana,arial,helvetica,sans-serif">4. Get the doamin ID using virsh list</div>
<div style="font-family:verdana,arial,helvetica,sans-serif"><br></div></div><div style="font-family:verdana,arial,helvetica,sans-serif">5. Get a xmldump of running domain virsh dumpxml <Domain-ID> <file-name> </div>
<div><font face="verdana, arial, helvetica, sans-serif"> e.g. virsh dumpxml 7 > /var/lib/one/template/one-149</font></div><div><font face="verdana, arial, helvetica, sans-serif"><br></font></div><div><font face="verdana, arial, helvetica, sans-serif">6. Open the XML and change the memory values, Save. Assume currently it is 1048576.</font></div>
<div><div> <memory>2095104</memory></div><div> <currentMemory>2095104</currentMemory></div><div><font face="verdana, arial, helvetica, sans-serif"><br></font></div></div><div><font face="verdana, arial, helvetica, sans-serif">7. Destroy the running domain </font> <span style="font-family:verdana,arial,helvetica,sans-serif">virsh destroy 6</span></div>
<div><font face="verdana, arial, helvetica, sans-serif"><br></font></div><div><font face="verdana, arial, helvetica, sans-serif">8. List all doamins in Shut-off state </font> <span style="font-family:verdana,arial,helvetica,sans-serif">virsh list --all</span></div>
<div><font face="verdana, arial, helvetica, sans-serif"><br></font></div><div><font face="verdana, arial, helvetica, sans-serif">9. If it is there in shut-off state, undefine it</font> <span style="font-family:verdana,arial,helvetica,sans-serif">virsh undefine <DOAMIn-NAME></span> </div>
<div> e.g. <span style="font-family:verdana,arial,helvetica,sans-serif">virsh undefine one-149</span></div><div><font face="verdana, arial, helvetica, sans-serif"><br></font></div><div><font face="verdana, arial, helvetica, sans-serif">10. Recreate the doamin using the XML </font> </div>
<div> e.g. <span style="font-family:verdana,arial,helvetica,sans-serif">virsh create /var/lib/one/template/one-149</span></div><div><span style="font-family:verdana,arial,helvetica,sans-serif"><br></span></div><div>
<span style="font-family:verdana,arial,helvetica,sans-serif">11. Connect through VNC , login as root and check with "free". You will see a higher MEM value </span></div>
<div><span style="font-family:verdana,arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:verdana,arial,helvetica,sans-serif">11. Give onevm top ,</span><span style="font-family:verdana,arial,helvetica,sans-serif">Wait for some time: OpenNebula reports the following.</span></div>
<div><span style="font-family:verdana,arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:verdana,arial,helvetica,sans-serif"><div>153 oneadmin oneadmin centos63 runn 5 <b>2G</b> onehost 0d 00h24</div>
<div><br></div></span></div><div><span style="font-family:verdana,arial,helvetica,sans-serif"><br></span></div><div><font face="verdana, arial, helvetica, sans-serif"> Thanks and regards,</font></div><div><font face="verdana, arial, helvetica, sans-serif">Anil Kumar</font></div>
<div><font face="verdana, arial, helvetica, sans-serif"><br></font></div><div><font face="verdana, arial, helvetica, sans-serif"><br></font></div><div><br></div><div>---- On Tue, 21 Aug 2012 22:38:39 -0700 <b>cloud.b.lab<<a href="mailto:cloud.b.lab@zoho.com" target="_blank">cloud.b.lab@zoho.com</a>></b> wrote ---- <br>
</div><div><div><br><blockquote style="padding-left:6px;border-left-color:rgb(0,0,255);border-left-width:1px;border-left-style:solid"><div><div style="font-family:verdana,arial,helvetica,sans-serif;font-size:10pt">
<div>As per my limited understanding:</div><div><br></div><div>The RAM size you specify in the VM template using "MEMORY=xxxx" translates to "Maximum available memory" for an active domain.<br></div>
<div>
Hence, while the domain being active , I think one cannot go beyond the available/max mem. </div><div><br></div><div>If you edit the XML file through libvirt and force change the Maximum memory value to anything higher, you may end up in Kernel Panic situation.</div>
<div><br></div><div>If you would like to try it , do the following:</div><div>1. Create a test vm</div><div>2. Verify the total memory using "free" command</div><div>3. Go to the machine running libvirt</div><div>
4. Get the doamin ID using virsh list</div><div>5. Save the current state of doamin using virsh save <Doamin_ID> <Filename-with-domain-name></div><div> (so that you have a copy of it) </div>
<div>6. Restore the doamin using virsh <Filename-with-domain-name></div><div>5. Edit the doamin XML using virsh edit <DOMAIN_ID></div><div>6. Try to change values for <memory> and <currentMemory> tags to a higher value divisible by 1024.</div>
<div> Assume current <memory> is 1048576.</div><div>e.g. </div><div> <memory>2095104</memory></div><div><div> <currentMemory>2095104</currentMemory></div></div><div>7. Try to reboot the doamin virsh reboot <DOAMIn-ID></div>
<div>8. Check available memory using "free"</div><div>9. Try issue setmaxmem command to increase memory to 2095104 virsh setmaxmem <DOAMIn-ID> 2095104</div><div><br></div><div><div>oneadmin@onehost:~$ virsh setmaxmem 4 2095104</div>
<div>error: Unable to change MaxMemorySize</div><div>error: Requested operation is not valid: cannot resize the maximum memory on an active domain</div></div><div>10. Try to increase available memory</div><div><div>oneadmin@onehost:~$ virsh setmem 4 2095104</div>
<div>error: Requested memory size 2095104 kb is larger than maximum of 1048576 kb</div></div><div><br></div><div>Hope this helps.....</div><div><br></div><div>Regards,</div><div>Anil.</div><div><br></div><div><br></div><div>
<div><br>---- On Tue, 21 Aug 2012 10:42:41 -0700 <b>Lawrence Chiong<<a href="mailto:junix88@gmail.com" target="_blank">junix88@gmail.com</a>></b> wrote ---- <br></div><br><blockquote style="padding-left:6px;border-left-color:rgb(0,0,255);border-left-width:1px;border-left-style:solid">
Hello,<br><br>Can anyone guide me a step-by-step guide on HOWTO change/update RAM on a fly / running VM (KVM). Because I tried changing my VM template (in sunstone) its Memory (e.g. from 2048M to 4096M) and then reboot my KVM VM but changes made doesn't take effect. So I tried manually changed the .../deployment.0 file and update the Memory element and update also the vm_pool table on body field +Memory element to 4096M then I restarted "oned" + "sunstone" so with mysqld BUT still the memory being updated doesn't changed.<br>
<br>Any help is very much appreciated. <br><br>Thank you.<br><br>Junix<br> _______________________________________________ <br>Users mailing list <br><a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a> <br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a> <br></blockquote><br></div></div>_______________________________________________ <br>
Users mailing list <br><a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a> <br><a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a> <br>
</div></blockquote><br></div></div></div></div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><br>
</div></div><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opennebula.org">Users@lists.opennebula.org</a><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Ruben S. Montero, PhD<br>Project co-Lead and Chief Architect<br>OpenNebula - The Open Source Solution for Data Center Virtualization<br><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:rsmontero@opennebula.org" target="_blank">rsmontero@opennebula.org</a> | @OpenNebula<br>
</div>