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?
Poking around in the provided workflows in vRO in v8 I found "Run program in guest".
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];
...
That's what cloud-init is for.
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.
I'd rather delete via REST API: Chapter 5. Using the Red Hat Satellite API Red Hat Satellite 6.4 | Red Hat Customer Portal
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..” . * +