vRealize Automation – Changing a Virtual Machine’s Business Group in 7.2 and 6.x

Changing business groups in both vRealize Automation v6 and v7 is a common task and below demonstrates how to automate the process. Luckily, VMware provides an out of the box vRealize Orchestrator workflow solution in both vRealize 6.x and 7.2, however, the workflow you need to use in both versions is different. Let’s have a look:

vRealize Automation 7.2

As of v7.2, we have a new workflow that changes the business group of the IaaS virtual machine entity as well as the CAFE deployment entity. The virtual machine entity is still part of the IaaS model, however, the deployment is a CAFE entity and therefore there are a few things you need to be aware of before changing the business group. We’ll cover those later. However, here is a screenshot of the workflow that you need to use:

The workflow you need to run to change business group can be found in the following location, noting this is under the Library folder:

screen-shot-2017-01-28-at-16-55-52

You need to provide the following inputs:

Screen Shot 2017-01-28 at 16.56.39.png

There are a few things to be considered.

1 – The owner of the virtual machine must also be a member of the target business group. The business group is determined based on the reservation you select. If the user is not a member of the target business group, the virtual machine IaaS entity business group will get updated, however, the deployment CAFE entity business group entity will not get updated, leaving you in a position where the 2 entities that are out of sync. If this is the case, your my items will be out of sync as the deployment will still appear under the original business group but the virtual machine will appear under the new business group.

2 – You may have more than one Virtual Machine within the deployment so make sure you update all virtual machine entities within the deployment.

3 – This workflow is not available prior to version vRealize Automation 7.2, although if you need it, contact VMware GSS support as they may be able to help you get your hands on a fix. Or, better still upgrade to vRealize 7.2.

Based on the above, one way I would implement this solution would be to create a day 2 operation on the deployment CAFE entity. Then you can do a couple of things as follows:

1 – Check that the owner of the deployment is a member of the target business group. If not, flag this on the day 2 XaaS form.

2 – Get all virtual machines that are part of the deployment so you update all virtual machines which are part of the deployment.

That’s it but you can enhance the custom day 2 resource operation if you need to.

vRealize Automation 6.x

In my opinion, it is slightly easier to update the virtual machine business group as we don’t have to worry about the CAFE deployment as the entity doesn’t exist in vRA 6.x. We do have MMBP, but this is part of the IaaS model which can be updated. This post just concentrates on single machine blueprints. The workflow you need to run to change business groups can be found in the following location, noting this is under the Library folder:

Screen Shot 2017-01-28 at 17.12.29.png

You can just run the import vCAC Virtual Machine and you can rerun this over an over again. It won’t register the machine multiple times but just update the business group based on the following inputs:

screen-shot-2017-01-28-at-17-14-02

You can see there are few more options to supply in vRA 6.x. You can also make this a day 2 operation by wrapping this workflow around another workflow as you can see the actual code that changes the business group is this:

vm.register()

Where vm is a vCAC:VirtualMachine type. You can see this in the ‘start register workflow‘ scripting element.

You can see the requirements parameters using the API library, but here’s a screenshot of what you need:

screen-shot-2017-01-28-at-17-18-32

That’s pretty much it. Happy Business Group Automating.

Advertisements

7 comments

  1. I’ve been searching for a guide to change the business group, however i don’t have either of the workflows you describe. I’m running the vRa 7.2 with vCo 7.1, connected to vCD 8.

    I have these options:

    vRealize automation > Infra Administration > Extensibility > Discovery
    – Import an IaaS Virtual Machine
    – Import vCenter Virtua Machine

    vCloud Automation Center > Infra Administration > Extensibility > Discovery
    – Register a vCaC Virtual Machine (Deprecated)
    – Register a vCenter Virtual Machine (Deprecated)
    – Unregister Virtual Machine

    Am i missing something?

    1. Hi Marcel. Load the embedded vRO server in your 7.2 appliance and look for the workflow there. You might be able to export that to your 7.1 external vCO server and run it from your 7.1 vCO server. There was a hotfix required to run this workflow in 7.1 but the hotfix was included in the 7.2 vRA appliance so it should in theory work. The hotfix includes to callback to CAFE so the CAFE Business Group entity is also updated. Let me know how you go?

      1. Thanks for your quick reply, however i’m afraid you lost me with your reply. I have no idea on how to do what you suggested. I don’t have an external vCo server.

        I have logged on to the vRa appliance with the vRo client and all i can find is what was in my posting.

      2. The workflow mentioned in the blog only exists in vRO version 7.2. You do have a vRO version 7.2 embedded with vRA 7.2.It seems you are running an external dedicated vRO 7.1 server so the workflow in the blog will not be available on that version. However, the workflow should be available on the 7.2 vRO server that is installed with the 7.2 vRA appliance. So you could load that by hitting the homepage of the vRA appliance (https://{vra_7.2_fqdn}) and going to the section ‘To connect to the built-in vRealize Orchestrator Server’ and clicking on vRealize Orchestrator Client. This should load the 7.2 orchestrator instance. Here you can browse for the workflow, export it to your 7.1 environment and try running it from there.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s