VMware Cloud Community
ShankarV
Contributor
Contributor

Workflow Stub for "Reconfiguration" of a VM

Hi Gurus,

I have a situation where I have to capture information about the VM's deployed on top of vCAC by users. I have an environment where vCAC can deploy VMs either on top of vCD or vCenter.

The basic idea is to call vCO workflows when the VM's are deployed on top of vCAC. That vCO workflow in-turn updates a database table with the information required (vmname, cpu, memory ..). So far, I have used vCAC extensibility and started calling my vCO workflows from there.

1) For VMs created - I used Machine provisioned Stub and called my vCO workflow which updated my database tables.

2) For VMs deleted - I used Machine unprovisioned Stub and called my vCO workflow which updated my database tables as well.

However, I also need to capture the VMs modified into my database. As the users are allowed to change the CPU/Memory/Storage from self service portal, I also need to track the changes made to VM. When I do a "Reconfigure" from self service portal; it does reconfigure a VM. However, it does not call any Stub so I can run my vCO workflow to update a VM.

Is there a stub or a state change which can be called when there is a reconfiguration initiated at vCAC? Or, what state does the reconfigure option fall into?

I read blogs and found its under "Manage State"; but, there isn't a stub for it.

Any ideas and thoughts on this is deeply appreciated. Thank you!

Regards,
Shankar V

0 Kudos
11 Replies
ShibbyB
Enthusiast
Enthusiast

Shankar,

  I think to get this sort of thing to trigger a workflow, you are going to need the CDK (Cloud Development Kit) license. I think this adds the ability to trigger a workflow when data is changed in the repository, on a scheduled basis, and at more points in the master workflow than allowed by stubs in the workflow designer.

One of the extensibility guys that watch the forums can probably provide more details.

0 Kudos
ShankarV
Contributor
Contributor

Thank you for your quick reply ShibbyB.

I am not sure if I can obtain a CDK license at the moment, though, I've sent a request for that. I'd wait for extensibility gurus to see if I find some light in the tunnel am struck.

Br, SV

0 Kudos
ShankarV
Contributor
Contributor

Looks like the CDK isn't going to be practical due to cost involved. Anyone has any other ideas for me to try please?

Br, SV

0 Kudos
admin
Immortal
Immortal

I'm not sure that you'll be able to wire this up on reconfigure, it uses the CDK events and/or schedules rather than states which the designer stubs are based upon as other have eluded to.

A not so great workaround, perhaps you could try update on state changes Power On/Power Off???  Maybe, you could fire your same workflow stub that you're using in provision/unprovision....

  <!-- machine is turning on -->

  <plugin fullName="DynamicOps.External.RepositoryWorkflows.InvokeRepositoryWorkflow" priority="1">

    <MasterWFStateCriteria>TurningOn</MasterWFStateCriteria>

    <MasterWFTypeFullNameCriteria>*</MasterWFTypeFullNameCriteria>

    <ExecuteWhen>PreActivityExecution</ExecuteWhen>

    <AssemblyPath>[ExternalWorkflowsDirectory]\DynamicOps.External.RepositoryWorkflows.dll</AssemblyPath>

    <AllPropertiesExist>

      <Property>TurningOn.Invoke.WorkflowName</Property>

    </AllPropertiesExist>

    <WorkflowArguments>

      <NameValue name="WorkflowName">WorkflowName</NameValue>

      <NameValue name="WorkflowTimeout">00:30:00</NameValue>

      <NameValue name="FailureState">Off</NameValue>

    </WorkflowArguments>

  </plugin>

  <!-- machine is turning off -->

  <plugin fullName="DynamicOps.External.RepositoryWorkflows.InvokeRepositoryWorkflow" priority="1">

    <MasterWFStateCriteria>TurningOff,ShuttingDown</MasterWFStateCriteria>

    <MasterWFTypeFullNameCriteria>*</MasterWFTypeFullNameCriteria>

    <ExecuteWhen>PreActivityExecution</ExecuteWhen>

    <AssemblyPath>[ExternalWorkflowsDirectory]\DynamicOps.External.RepositoryWorkflows.dll</AssemblyPath>

    <AllPropertiesExist>

      <Property>TurningOff.Invoke.WorkflowName</Property>

    </AllPropertiesExist>

    <WorkflowArguments>

      <NameValue name="WorkflowName">WorkflowName</NameValue>

      <NameValue name="WorkflowTimeout">00:30:00</NameValue>

      <NameValue name="FailureState">On</NameValue>

    </WorkflowArguments>

  </plugin>

0 Kudos
d-fens
Enthusiast
Enthusiast

You can adjust the existing "reconfigure" workflows to your need. If you do not want to or cannot use the CDK license you can still edit them in the designer. But for that you will have to first "unprotect" them by setting their value in [DynamicOps.RepositoryModel].[WorkflowDefinitions] by setting "IsProtected" to 0. Note: this is generally not supported by GSS.

Ronald Rink d-fens GmbH
0 Kudos
jlholbrook
Enthusiast
Enthusiast

Great guidance! This actually helped me accomplish what I'm looking for, however I'm hoping you can nudge me along just a bit more. From the vSphereReconfigureVM workflow I fire a vCO workflow which receives the virtualMachineId then uses this to get the vCAC:virtualMachine and vCAC:Host.

What I'm trying to determine is how I might go about getting the details about what was reconfigured. As an example, Essentially, I want to log the current VM configuration, and the proposed changes for VM resources, not sure if the vSphereReconfigureVM workflow has this summarized anywhere.

Thank you to anyone who can help me solve this and save me some of my weekend.

0 Kudos
jbweber2
Enthusiast
Enthusiast

The info for a reconfigure request exists in the VMwareModelEntities repository model.

ReconfigureRequests

-> ReconfigureRequestNetworks

  -> ReconfigureRequestNetworkProperties

-> ReconfigureRequestStorages

  -> ReconfigureRequestStorageProperties

The correct request can be looked up via the id of the state operation (the entity is responsible for triggering the reconfiguration request stuff).  You should just be able to pass this id to vCO and then lookup the entities via the VCAC plugin fairly easily.

If you had the CDK you could get this same functionality by creating a new event workflow and attaching it to the state you're interested in on the state operation table. I believe in this case you would want to run your workflow at a config that matches the following with the workflow you built to kick off your logic.ReconfigureVMGeneric is the base router used to make reconfiguration logic kick off.

ReconfigureVMGeneric                      │ StateOperation              │ Updated         │ StateOperationDefinition.Name Equal ReconfigureVM, and StateOperationExecutionState.Name Equal ReconfigureVM.ExecutionUpdated

This is the workflow state which will cause vSphereReconfigureVM to get scheduled and run.

0 Kudos
jlholbrook
Enthusiast
Enthusiast

Thank you for the information, we'll do a bit of tinkering around and see what we can come up with! I'll share any updates to the thread for others.

0 Kudos
aamodei01
Enthusiast
Enthusiast

Hello Folks,

I know this is an older thread, but I was wondering if you could explain this in a bit more detail.

I am trying to accomplish running a few items when a user reconfigures a vm (specifically my workflow is built off of the 'workflow template' with vCACVM, vCenterVM, virtualmachineEntity, vCACHost, externalWFStub,vCACVmProperties, and host)

When our users add a new disk after the VM has been provisioned, I need my workflow to run, which set HD3 and up to independent-persistent. My workflow does this fine at provisioning time, but I need to account for a reconfigure of the VM somewhere later down the line. Right now, it's just adds a standard dependent disk.

I was able to unprotect the vSphereReconfigureVM workflow for use in the advanced designer, but I'm not sure of where to place the InvokeVcoWorkflow item in there and how to populate the above mentioned variables.

Any help is welcome, thanks!

0 Kudos
Venkatanagesh
Contributor
Contributor

Hi,

I'm trying to fire a VCO Workflow from vSphereReconfigureVM.  Can you please guide me with the instructions to modify reconfigure VM workflow using VCAC Advanced designer to acheive this?

Thanks in advance.

0 Kudos