Site Tools


Hotfix release available: 2024-02-06a "Kaos". upgrade now! [55.1] (what's this?)
New release available: 2024-02-06 "Kaos". upgrade now! [55] (what's this?)
restarting_virtual_machines

Rebooting and restarting Virtual Machines.

From: Michael C Voorhis <mvoorhis@cs.wpi.edu>
To: "John Leveillee" <jleveillee@cs.wpi.edu>
Cc: "'Michael C Voorhis'" <mvoorhis@cs.wpi.edu>
Subject: vmware reboot?
Date: Fri, 9 Sep 2011 08:52:47 -0400

John Leveillee writes:

Mike, Can you please provide me the vmware procedure for rebooting
machines? Thanks, John

CS-VM2 is our virtual machine server, It is running 13 VMs right now. VMWare is a program for running virtual machines but is *not* the system we use on cs-vm2; we use something called KVM there, it is a free system associated with Linux. Some virtual machines use vmware, but not all of them.

Anyway–we need to make sure you can ssh/PuTTY into cs-vm2.cs.wpi.edu, and we need to make sure you can run SUDO there. Last time I checked you were able to run sudo there, and it does look like you logged in there on the 6th. Check anyway. :)

Note that when you login to cs-vm2, You'll see a login-message saying that the system wants a reboot. Ignore that–we'll reboot it sometime after I come back. Even if you decide to reboot it, it should come back up no problem anyway.

So.. try logging in there and run:

  sudo virsh list --all

That command will show all the virtual machines that are running on the server (and those that are installed there but not active).

Now, if you want to shutdown one of these machines, the most sensible way would be to login to the vm itself (Sequoia, for example) via SSH and run

  sudo shutdown -h now "Reason for shutdown"
        or
  sudo shutdown -r now "Reason for rebooting"

Note the -h means “shutdown and halt” and -r means “shutdown and reboot.” Asking the OS to shut itself down is always the better, cleaner solution.

But if the VM is hung or locked up and not responding (or you don't have an account there–some of these VMs are project boxes where even I don't have an account!), then you can't actually log into it and do the shutdown. So you need to back up a level and do what we're talking about here–the VM equivalant of pulling the plug on a machine you can't reach any other way. The command from cs-vm2 to pull the plug on a VM would be

      sudo virsh destroy [vm-name]

This will cause the VM to immediately shut off. You would follow this up with

      sudo virsh start [vm-name]

which would cause the VM to boot after being shutoff. Most VMs will reboot in a pretty short period of time, perhaps a minute for machines like Sequoia, but the smaller VMs, like the print server, the samba server or the webserver should be back up in under a minute. Sometimes you can reboot them without anyone noticing the downtime, which is great.

If you would like to test the shutdown/reboot procedure, you can give it a try with the “mag-iqp” or “cskrb0” machines, which are only very occasionally used.

See you soon,

–MCV

restarting_virtual_machines.txt · Last modified: 2011/09/09 12:57 by mvoorhis