Configuring VM Power Schedules

You can automatically power VMs on and off at specified times using power schedules. Power schedules are especially useful for the public cloud, where you pay more when VMs are running. But private cloud VMs that are running unnecessarily consume resources as well.

It's still possible to manually power on and use a VM during the scheduled power-off period.

In this topic:

Steps to configure VM power schedules

The steps to configure automatic power-on and power-off schedules are:

  1. Configure power schedule groups.
  2. Assign existing VMs to a power schedule group.
  3. Set the power schedule group for new VMs.
  4. Monitor power schedule recommendations to ensure that all VMs in your virtual infrastructure have an optimal power schedule.
  5. Configure the rules used to generate power schedule recommendations if necessary.

Configure power schedule groups

Access through:

Configuration menu > Groups > Power Schedule

Available to:

vCommander Role of Superuser and Enterprise Admin

Administrator Access Rights

  1. On the Power Schedule Groups page, click Add.
  2. On the Name & Description page, provide a name for the group (maximum 100 characters), with an optional description.

    Notes:

    • Give the group a descriptive name so that it makes sense when viewing the service's Power Schedule Group property, applying a recommendation and setting the group manually. For example, if you're creating a power schedule group for VMs that should be powered on during business hours in Eastern Standard Time, you could name it "Mon-Fri 9-5 EST".
    • The schedules use the time on the vCommander application server. If you have Service Portal users in multiple time zones, set an appropriate schedule name and description (for example, including the time zone), to make sure the schedule is clear to users.
  3. On the Schedule page, configure the schedule. Times are local to the vCommander server.
  4. On the Summary page, review the settings and click Finish.

Assign existing VMs to a power schedule group

Access through:

Views menu > Operational, Deployed, or Storage

Available to:

Administrator and All Operator Levels of Access Rights

To set the power schedule for existing VMs, you add the VMs to a power schedule group.

Notes:

  • You can see what power schedule group a VM belongs to on the Details pane of the Summary tab. For information about displaying the power schedule group on the Details pane, see Customizing the vCommander Display. The Power Schedule Group property is in the Lifecycle category.
  • You can also use the Set Groups on Children command to assign many VMs to a group at the same time.
  • Required Service Portal permissions: Service Portal users can view the power schedule group for their VMs. However, they require the Modify Power Schedule Groups permission to assign their VMs to power schedule groups. See Customizing Service Portal Roles for End Users for more information on these permissions.

To assign existing VMs to a power schedule group:

  1. Navigate to the VM either through the tree or the Virtual Machines tab.
  2. Right-click and choose Power > Set Power Schedule Group.
  3. In the Set Power Schedule Group dialog, select the appropriate group, and click OK.

Set the power schedule group for new VMs

There are three ways to set the power schedule group when a VM is deployed:

  • the service catalog
  • completion workflows
  • policies

See Guidance for assigning groups to new services to learn which which method is best for your situation.

Example: Setting the power schedule group for new VMs

The following example shows you how to set the power schedule group with a completion workflow based on a request form field value.

  1. Create a list-type custom attribute named "24-hour uptime required", with selectable values of "yes" and "no".
  2. Add this custom attribute to the service catalog blueprint, first on the Attributes tab, and then on the Form tab.
  3. Create a component-level completion workflow, or edit an existing completion workflow:
    • On the Steps page, click Add > Lifecycle Management > Set Groups.
    • From Step Execution, choose Execute when conditions are met, and click Edit.
    • In the Variable Assistant dialog, enter the following in the Condition field: #{target.settings.customAttribute['24-hour uptime required']} -eq yes
    • In the Set Groups Step Details pane, click Add Groups.
    • In the Add Groups dialog, select Power Schedule Group, and click OK.
    • From Power Schedule Group, select the Always On group.
    • Add another Set Groups step to the workflow, with the condition #{target.settings.customAttribute['24-hour uptime required']} -eq n, and the power schedule group set to Weekdays.
    • On the Assigned Components page of the wizard, make sure the workflow is assigned to the appropriate service components.

Deleting power schedule groups

Access through:

Configuration menu > Groups > Power Schedule

Available to:

vCommander Role of Superuser and Enterprise Admin

Administrator Access Rights

To delete a power schedule group, select the group, click Delete and confirm the deletion.

Caution: When you delete a power schedule group, all VMs in the group are automatically unassigned from the group.

How VMs are powered on and off

When the scheduled power-on and power-off are executed, one task starts and stops all VMs. Events are generated for each VM power-on and power off. A Shutdown Guest OS command is executed if supported by the hypervisor; otherwise, a Stop VM command is executed.

Public cloud VMs: vCommander checks the VM's power state before sending the shutdown request. If a public cloud VM's power state was changed outside vCommander since the last automatic or manual inventory synchronization, vCommander won't be aware of the state change.