VMware Cloud Community
Ruchi1
Contributor
Contributor

vRO with Hitachi storage

Hi,

There is one default workflow in Hitachi plug-in as Smart Provision a LUN / Datastore to ESXi Host Cluster, in which the datastore is being added to only one host in the cluster,

My requirement is to add the same datastore to all the other esxi host present in that Cluster.

If anyone has done something related to the same Please help me.

Thanks in Advance.:-)

5 Replies
iiliev
VMware Employee
VMware Employee

Hi,

Is this plug-in available somewhere?

For your requirement, are you looking for a way to obtain a list with hosts in a given cluster? In vCenter object model, this can be done easily with the following code:

var hosts = cluster.host;

where cluster variable is of type VC:ClusterComputeResource, and the result variable hosts is an array containing elements of type VC:HostSystem.

Not sure whether this Hitachi plug-in uses its own abstraction model/scripting classes for clusters, hosts, etc., different from vCenter plug-in model.

0 Kudos
Ruchi1
Contributor
Contributor

Hi,

I have Hitachi plug-in with vRO and I have to perform the task using vRO only, As I told before there is one default workflow which is adding the datastore to one host . I have to add the same datastore to all host under the same cluster(in which the first host is present to which datastore got added).

May be some loop or something that can perform the same task to all host .

Thank You for your reply 🙂

0 Kudos
iiliev
VMware Employee
VMware Employee

You can do such loop in several ways:

1) vRO provides Foreach element (on Generic palette), so if you have an attribute of type Array/VC:HostSystem containing all the hosts you want to to add the datastore to, the Foreach element will iterate over each host in this array and will call your workflow passing the iterated host as an input parameter to it.

2) You can also implement the loop yourself, using approach similar to one used eg. in the workflow 'Rescan datacenter HBAs'

3) Iterate over the list with hosts using Javascript code and call the workflow programmatically (this would require more code so I see no reason to go this route).

Ruchi1
Contributor
Contributor

Thank you !  Ilian Iliev​, But I am not sure how to use the foreachelement here in respect to adding datastore to the oyher hosts of the cluster as in the default workflow the input is hostname, so shalll i change it with Array/VC:HostSystem

this is the workflow

pastedImage_0.png  pastedImage_1.png

0 Kudos
iiliev
VMware Employee
VMware Employee

No, you shouldn't change it!

Just prepare the arrays that will be iterated and their elements will be used as an input parameter during each foreach iteration (eg. attribute of type Array/VC:HostSystem for the first parameter, attribute of type Array/String for the second parameter datastore name, etc.). Then drop the Foreach element on the schema, select your workflow, click promote button, and bind workflow inputs to the corresponding attribute arrays with the actual information to iterate on. That's all.

0 Kudos