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");
var allVMs = VcPlugin.getAllVirtualMachines(null, vmName);
var vm = allVMs;
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.