wiki:Remctl

We use remctl to pass commands back and forth between our different servers, and we've added the ability for you to tap into this to control your VMs without using the web interface.

If you don't have remctl installed locally (there is a remctl-client package in Debian and Ubuntu), you can run it out of the remctl locker by first typing

athena% add remctl

Once you've done that, you can use any of the following commands to manipulate your VM (using our test VM, moo17, as an example)

For information about the state of your VM:

athena% remctl remote.mit.edu control moo17 list
athena% remctl remote.mit.edu control moo17 uptime
athena% remctl remote.mit.edu control moo17 list-long

To start up your VM:

athena% remctl remote.mit.edu control moo17 create

To attempt to cleanly shutdown your VM:

athena% remctl remote.mit.edu control moo17 shutdown

To hard shutdown your VM:

athena% remctl remote.mit.edu control moo17 destroy

To hard reboot your VM:

athena% remctl remote.mit.edu control moo17 reboot

There's also a script called xvm in the xvm locker that gives you an interface reminiscent of init.d:

athena% add xvm
athena% xvm moo17 start
athena% xvm moo17 stop

You can run xvm --help for more information.

To automate installs:

The install command allows installing in a variety of ways.

Debian preseeds and Red Hat kickstarts can be triggered through by passing the preseed= or ks= arguments:

remctl xvm-remote control username-vm install mirror=http://ftp.us.debian.org/debian dist=stable arch=amd64 preseed=https://web.mit.edu/username/Public/preseed.cfg

An arbitrary Debian-style mirror can be passed, and the XVM host will download the kernel and initrd from the mirror, and boot it passing in the preseed URL. Creating a custom preseed then allows control over the install process.

Similarly, the ks= argument allows using a Red Hat mirror.

The relevant implementation is in the invirt-xen-config.git repo and may help construct appropriate commands.

This functionality is not necessarily guaranteed to remain stable.

The XVM SerialConsole (ssh -oGSSAPIAuthentication=yes username-vm@xvm-console.mit.edu) can be used to control the install.

Last modified 3 months ago Last modified on Aug 20, 2024, 12:51:37 AM