VMware Cloud Community
_MikeW_
Enthusiast
Enthusiast

[vRA 8.X] vRO workflow for RedHat registration/de-registration during provisioning/deletion

Is there any good documentation on how to deal with RedHat registration for VM creation/deletion? What I really need is for the VM workflow to run a script or command line on creation (if RedHat) and similarly when the VM is deleted. I just can't find any decent source of documentation on how to manage that for v8.

Can anyone point me to a similar project walk through that would be helpful?

Reply
0 Kudos
5 Replies
_MikeW_
Enthusiast
Enthusiast

Poking around in the provided workflows in vRO in v8 I found "Run program in guest".

var host = vm.sdkConnection;

var guestOperationsManager = host.guestOperationsManager;

var guestAuth = new VcNamePasswordAuthentication();

guestAuth.username = vmUsername;

guestAuth.password = vmPassword;

guestAuth.interactiveSession = interactiveSession;


var guestProgramSpec = new VcGuestProgramSpec();

guestProgramSpec.programPath = programPath;

guestProgramSpec.arguments = arguments;

guestProgramSpec.workingDirectory = workingDirectory;

guestProgramSpec.envVariables = environment;


var processManager = guestOperationsManager.processManager;

result = processManager.startProgramInGuest(vm , guestAuth , guestProgramSpec);

So it looks like I can use this as a baseline to trigger my commands I need run. My only question is how to capture the "VC:Virtualmachine" that triggered the subscription to run? I am wondering if there is a better way to do it than

vmName = inputProperties.get("resourceNames")[0];

var allVMs = VcPlugin.getAllVirtualMachines(null, vmName);

var vm = allVMs[0];

...

Reply
0 Kudos
xian_
Expert
Expert

That's what cloud-init​ is for.

Reply
0 Kudos
_MikeW_
Enthusiast
Enthusiast

Which, as I said is only useful for provisioning, not deletion so not a real solution... unless you know a way to trigger a cloud-init on delete w/o doing what im already trying to do (run a command on a subscription event.

Reply
0 Kudos
xian_
Expert
Expert

Reply
0 Kudos
evil242
Enthusiast
Enthusiast

Satellite is a version of Ansible, for which there's the extensibility plugin for vRA.  Does anyone have documentation for getting it to work with RHN's Satellite server?

Damion Terrell  .   +  (He/Him)  +  . *  .  +   @   + .    *  .    +      .                    
Core IT Service Specialist * . + * . + . + . + * +
UNM – IT Platforms – VIS + . . . . . . . . .
. + . + * . + * .
* . . + . . . . + . + * + .
“You learn the job of the person above you, * + . + * @
and you teach your job to the person below you..” . * +
Reply
0 Kudos