Automatically shutting down individual VMs in an environment
Though this isn’t a capability supported by Skytap, you can use guest OS tools and settings to shut down individual VMs to help keep usage with your account limits. When Skytap detects that an individual VM is shut down or suspended, that VM stops counting against your account usage.
Guest OS-initiated shutdown can be difficult to configure, particularly for Windows VMs. A simpler, more reliable solution is to put an x86 VM in its own environment (with unique auto-shutdown settings) and connect it to VMs in other environments (see Networking between environments).
Automatically shutting down an inactive Windows VM
To automatically shut down individual VMs after a period of inactivity, use the Windows Task Scheduler in each Windows VM. This method allows you set different policies for VMs in the same environment.
To shut down a Windows VM after a period of inactivity
- Right-click Start > Run, and then type
taskschd.msc
to start the Windows Task Scheduler. - In the Actions pane, click Create Task. The General tab of the Create Task window displays.
- Type a Name for the task.
- Click Change User or Group. The Select User or Group window displays.
- Under Enter the object name to select, type Users, and then click OK.
- Check the box next to Run with the highest privileges.
- Click the Triggers tab, and then click New. The New Trigger window displays.
- From the Begin the task menu, choose On idle, and then click OK.
- Click the Actions tab, and then click New. The New Action window displays.
- In the Program/script field, type
C:\Windows\System32\shutdown.exe
. - In the Add arguments field, type
/s
, and then click OK.
- In the Program/script field, type
- Click the Conditions tab.
-
Check the box next to Start the task only if the computer is idle for and choose how long the computer can be idle before the task timer starts.
The minimum idle time should be at least 15 minutes to allow all Windows services to start.
-
Check the boxes next to Stop of the computer ceases to be idle and Restart if the idle state resumes.
-
- Click OK to save the scheduled task.
For more information about using Windows Task Scheduler, see Task Scheduler.
Automatically shutting down an inactive Linux VM
There are several open-source tools that will shut down an idle Linux VM. The example below uses GShutdown.
To shut down a Linux VM after a period of inactivity
- Download and install GShutdown.
- Launch GShutdown.
- From the Select a time menu, choose After a delay.
- In the fields below, choose how many hours and minutes the guest OS should remain idle before shutting down.