Adding memory to a virtual machine: Difference between revisions

From DISI
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:


  virsh list  # Show all VMs
  virsh list  # Show all VMs
# Extract pan (sgemaster) configuration for local modification
  virsh dumpxml pan.slot-31.rack-1.donnelly.cluster.uoft.bkslab.org > ~/pan.xml.tmp  # Extract pan (sgemaster) configuration for local modification
  virsh dumpxml pan.slot-31.rack-1.donnelly.cluster.uoft.bkslab.org > ~/pan.xml.tmp   
  vim ~/pan.xml.tmp
  vim ~/pan.xml.tmp
  These lines
  These lines

Revision as of 18:40, 22 January 2014

Use "virsh", either locally:

root@rocky$ virsh (COMMANDS HERE)

or remotely:

teague@spinaltap$ virsh --connect qemu:///rocky.cluster.uoft.bkslab.org/system (COMMANDS HERE)

We want to change the configuration for a running VM. Doing this requires dumping the current configuration to a text (XML) file, editing it, and pushing the changes to the hypervisor. I will show this with the local version for brevity.

virsh list  # Show all VMs
virsh dumpxml pan.slot-31.rack-1.donnelly.cluster.uoft.bkslab.org > ~/pan.xml.tmp  # Extract pan (sgemaster) configuration for local modification
vim ~/pan.xml.tmp
These lines
 <memory unit='KiB'>4194304</memory>
 <currentMemory unit='KiB'>4194304</currentMemory>
   to this
 <memory unit='KiB'>16777216</memory>
 <currentMemory unit='KiB'>8388608</currentMemory>

This changes the currently used memory from 4GB to 8GB and raises the max memory that can be allocated w/o rebotting from 4GB to 16GB

virsh define ~/pan.xml.tmp  # Upload the new configuration to the hypervisor (overwrites pan.slot-31....)
virsh shutdown pan.slot-31.rack-1.donnelly.cluster.uoft.bkslab.org
virsh start pan.slot-31.rack-1.donnelly.cluster.uoft.bkslab.org

To remove jobs:

qconf -as pan.slot-27.rack-1.pharmacy.cluster.uoft.bkslab.org  # I forgot to make pan a submit node, needed for deleting
qstat -u '*' | tail -n+3 | cut -f2 -d\ | xargs -L 250 qdel -f   # -L 250 means send chunks of 250 job ids to qdel