Colleagues,
I've created two jobs to perform regular weekly cloning of the server. It consists of two separate scheduled workflows. One deletes existing clone, another one clones the protected VM 10 minutes later. The name of the deleted and newly cloned VM is the same.
Both tasks worked just once and then stopped.
Removal task failed with the follwoing error: "TypeError: Cannot read property "runtime" from undefined (Dynamic Script Module name : destroyVm#52993)". Cloning task failed because there was another vm with the name it was supposed to use for new clone (the reason is clear).
For me destroyVm#52993 looks like VCO tries to remove the VM by its VMID, which apparently changes after each cloning.
So i wonder:
- If anyone configured regular cloning with VCO and how it was done?
- If there's workflow for VM's removal by its name, not vmid?
Any feedback would be very appreciated.
Thanks.
Hi Corochun,
i'm not really sure what your worklows are doing - please put them into a package and load it up in this discussion.
Instead of using two seperate workflows, use one combining both tasks.
All activities with / against objects are done by its ID or direct by object methods, because it is bijective. A name is just a label and can change.
Of course, you can retrieve an ID (object) by searching its name (label). But you are responsible for that the found ID that it is the one you want. So you have to check for double names.
A possible workflow for your task could look like this:
input parameter:
if VMclone != null -> destroy VMclone
Temp = clone VMclone // to store VM object in Temp, giving it an individual name to display in vcenter
schedule workflow to desired time with VMsource=VMsource VMclone=Temp
This WF will run and reschedule itself, optionally you can pass the time as parameter. No name from outside is needed.
Post your package, i will take a look and post my package back
-
don't forget: award points to helpful answers
Hi,
Sorry for keeping this inactive for so long - I just wasn't anywhere near to civilization. Happy New Year, by the way.
I'm really new to the vCO, so your answer just produced more questions for me. The very first one is "how do i do this?".
Well it would have been inhonest to ask for a detailed instruction on how to create a custom workflow (so far i've been using predefined ones), so i will take my time to dig into this with documentation.
Will post here within 2 weeks when i have (hopefully) someting.
Thank you,
Kirill.
Hi Kirill,
no problem, welcome back in civilization 🙂
So you want an example with following features:
If so, I will build a small example and post a package for import.
Regards, Andreas
Hi Kirill,
attached an example workflow as package for import.
There could be a problem with the scheduled workflow, because I don't know if the ID in this is recalculated. If an error on this item occurs, just remove the scheduled item and insert again by drag and drop.
It is only an example for you to understand how to build own workflows. Do not use for production, because:
What is this example doing:
Here a snapshot from VC an vCO (running with 5min schedule - look at comment in calc value)
Regards, Andreas
Hi Kirill,
if you have general questions on how to edit a workflow (inserting items, using parameters, etc) just write a PM.
Regards, Andreas
Hi Kirill,
how far you are in digging 😉 vCO - two weeks are gone, if you need help or support, just quote or PM.
Regards, Andreas
Hi Kirill,
is this still open?
Do you need more?
Pls let us know or close question. Don't forget to award points for useful answers.
Regards, Andreas