08-15-2016 12:16 PM - edited 03-01-2019 06:43 AM
Task Name | Example on converting VM Name TO Vm ID |
Description | |
Prerequisites | Tested on 5.5 |
Category | Workflow |
Components | vSphere 5.x |
User Inputs | |
Instructions for Regular Workflow Use:
The Workflow:
Input:
Workflow Run:
When the VM Name is not found:
Is there a custom task to do the opposite VMID 2 VMNAME like with the VDC custom tasks we have?
I need to use the VMName inside a VIX task (the workflow has only loop and vix) and ${VM_NAME} macro doesn't work unless i use VM Context but then again i need to use a loop task as well so i'll get the same ${VMname} value every iteration run if i use a VM Context WF.
take a look inside the custom task. I am looking at a certain report (screen) and a column. you have to just swap the algorithm to a different column.
just looked inside the task...
// Filter 1
report = report.filterRowsByColumn("VM Name", vmname, false);
var i=0;
var numRowsFound = report.rowCount();
var pgn = report.getColumnValue(i, "VM-ID");
I am looking for column "VM NAME" vs you want to look for "VM-ID" and then get the ColumnValue of "VM Name"
clone the task and change input vars / out put
I cannot import this into UCSD 6.0.1.0. I get a "Workflow Import Thread Exception" on the last screen of the import page. Here's what's in the log:
2017-02-20 20:34:02,113 [ORR-InfraMgr:A4CB8EAB83] INFO run(OperationRequestReceiver.java:38) - Received operational request, added to queue.
2017-02-20 20:34:02,113 [ORP-1-9] INFO run(OperationRequestProcessor.java:79) - Executing request... requestId=2728; opName=doFormSubmit
2017-02-20 20:34:02,113 [ORP-1-9] INFO doFormSubmit(APIProvider.java:1297) - FORM SUBMIT CustomAction.mimp.form.add
2017-02-20 20:34:02,114 [Thread-4498] ERROR run(WFDXImportConfirmationPage.java:367) - java.lang.NullPointerException
2017-02-20 20:34:08,070 [ORP-1-9] INFO setEmbeddedLOVs(Page.java:752) - set embedded lov 31 for ExistingFolder
2017-02-20 20:34:08,070 [ORP-1-9] INFO invoke(ServiceBinder.java:201) - Executing method getAllProductAccess; operationTimeout=90000
2017-02-20 20:34:08,080 [ORP-1-9] INFO invoke(ServiceBinder.java:213) - Returning result. returnType=class [Lcom.cloupia.model.cID.cIdAccess.ProductAccess;
2017-02-20 20:34:08,084 [ORP-1-9] INFO sendNotificationEmail(EmailPolicyNotificationEmailSender.java:49) - Send email option is disabled : false
2017-02-20 20:34:08,085 [ORP-1-9] INFO run(OperationRequestProcessor.java:140) - Sending response... requestId=2728
I just downloaded it and unzipped it and imported it and ran it. Did you unzip it?
D'oh...I don't know what I was thinking. Yeah, that was it. It imports fine now.
Good... are you interested in participating in the UCSD Glacier Beta Program? If so send me your e-mail to ogelbric@cisco.com Starts March 8th. I am testing alpha looks really cool.
Never mind I tracked you down - e-mail coming shortly
Hi, Quick question, when I use the workflow it works like a charm. However I have to use it as a step in a different workflow (creating server flow). So I made it a compound task and call it in the main workflow where i fill the VMName input with a output of an earlier step. But when I do it this way it always return -1 -> can't find the vm Below are the different output. First is when I run the original, second one is the child request
1)
Feb 20, 2019 09:31:12 CET Trigger context executeWorkFlowStep called Feb 20, 2019 09:31:12 CET Executing custom action VMName_2_VMID (custom_vmName2vmID) Feb 20, 2019 09:31:12 CET Executing custom action VMName_2_VMID (custom_vmName2vmID) Feb 20, 2019 09:31:12 CET Executing custom script for vmName2vmID Feb 20, 2019 09:31:12 CET VM Name Input : V01W0666 Feb 20, 2019 09:31:13 CET reportName : TABULAR_REPORT_VMS_PAGINATED_CONFIG_REPORT Feb 20, 2019 09:31:13 CET report : com.cloupia.lib.util.managedreports.TableView@1ba27975 Feb 20, 2019 09:31:13 CET Greater then Zero...............: Feb 20, 2019 09:31:13 CET Greater then Zero...............: Feb 20, 2019 09:31:13 CET Number of Rows found...............: 1 Feb 20, 2019 09:31:13 CET Processing output: VMID Feb 20, 2019 09:31:13 CET Task #2 (VMName_2_VMID (custom_vmName2vmID)) completed successfully in 0 seconds Feb 20, 2019 09:31:13 CET Input/Output values for Task #2 (VMName_2_VMID (custom_vmName2vmID)): Feb 20, 2019 09:31:13 CET [Mapped Input: VMname = V01W0666] Feb 20, 2019 09:31:13 CET [Output: VMID = 1945]
2)
---- Feb 20, 2019 09:02:17 CET Trigger context executeWorkFlowStep called ---- Feb 20, 2019 09:02:17 CET Executing custom action VMName_2_VMID (custom_vmName2vmID) ---- Feb 20, 2019 09:02:17 CET Executing custom action VMName_2_VMID (custom_vmName2vmID) ---- Feb 20, 2019 09:02:17 CET Executing custom script for vmName2vmID ---- Feb 20, 2019 09:02:17 CET VM Name Input : V01W0666 ---- Feb 20, 2019 09:02:19 CET reportName : TABULAR_REPORT_VMS_PAGINATED_CONFIG_REPORT ---- Feb 20, 2019 09:02:19 CET report : com.cloupia.lib.util.managedreports.TableView@5ccf8ef9 ---- Feb 20, 2019 09:02:19 CET Greater then Zero...............: ---- Feb 20, 2019 09:02:19 CET Zero or Less...............: ---- Feb 20, 2019 09:02:19 CET Number of Rows found...............: 0 ---- Feb 20, 2019 09:02:19 CET Processing output: VMID ---- Feb 20, 2019 09:02:19 CET Task #2 (VMName_2_VMID (custom_vmName2vmID)) completed successfully in 2 seconds ---- Feb 20, 2019 09:02:19 CET Input/Output values for Task #2 (VMName_2_VMID (custom_vmName2vmID)): ---- Feb 20, 2019 09:02:19 CET [Mapped Input: VMname = V01W0666] ---- Feb 20, 2019 09:02:19 CET [Output: VMID = -1]
Whow - something must have gone astray - I had 7 messages in my in box this morning...
Ok I am testing now
Regular catalog with post provisioning attached which will send me an e-mail
Compound task is enabled and VM context
That workflow calls a compound task with also VM context enabled.
Will see how far down the chain the VM context is passed.
my email contains
This is post provisioning 1
SR-ID: ${SR_ID}
VM_NAME : ${VM_NAME}
VM_ID : ${VM_ID}
VM_IPADDRESS: ${VM_IPADDRESS}
SUBMITTER_EMAIL: ${SUBMITTER_EMAIL}
stay tuned
Not sure I follow - I used a standard catalog and have a post provisioning attached and it know that VMID. Not sur ehow you can have a workflow creating a VM and the VM does not exists.
There is a task to run inventory on vCenter and or VM (By VMid).
There is also this task to run inventory on any system task.
if you send me an e-mail we coud have a webex and I could take a look at your situation. Waiting the workflow for an hour does not sound very good.
ogelbric@cisco.com
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: