Thank you very much for voting! The poll is still opened, so feel free to check it in.
vCenter allows us to schedule the creation and deletion of virtual machine snapshots—a highly useful feature. While the same functionality can be achieved using a pure VCF Orchestrator, today we will explore how to leverage the Orchestrator to configure this scheduler.
Plan
I will create a workflow that allows selecting a virtual machine to be scheduled for a snapshot. The workflow will support the following features:
- one or more VMs
- create a delete snapshot
Logic

Virtual Machine management class
I already have a VirtualMachineManagement
, therefore, I am going to extend it by adding more methods.
To work with a scheduler, it should be invoked in a context of the VM I want to work on.
Get Service Instance
In VCF Orchestrator, ServiceInstance
is a core object that represents a connection to a vSphere environment, typically a vCenter Server instance.
What is ServiceInstance in vRO?
It is the root object for accessing the vSphere API in vRO.
It allows vRO scripts and workflows to interact with vCenter Server, retrieving various managed objects such as Virtual Machines, Hosts, Datacenters, Clusters, and more.
First, I need to define the virtual machine (VM) as a ServiceInstance
.
VirtualMachineManagement.prototype.getServiceInstance = function (vmName) {
var sdkConnection = vm.sdkConnection;
var serviceInstanceReference = new VcManagedObjectReference();
serviceInstanceReference.type = "ServiceInstance";
serviceInstanceReference.value = "ServiceInstance";
return VcPlugin.convertToVimManagedObject(sdkConnection, serviceInstanceReference);
};
Get Service Instance function
Now that I have a ServiceInstance
object, it contains an attribute called content
, which is of type VcServiceContent
. This object provides access to numerous managers, but the one I'm particularly interested in is the scheduledTaskManager
.