https://pulumi.com logo
g

gentle-soccer-81698

05/05/2020, 7:23 PM
Hi all! Pulumi n00b here, but I'm moving right along. I basically have an entire vSphere datacenter automated with Python and Pulumi. The only problem that I'm seeing is vSphere HA is trying to configure on the hypervisors before datastores have been created and mounted and thus failing. I'm not seeing a
dependsOn
flag in
opts=
for the vSphere cluster resource. Looking through the docs that's where I see the flag but I don't see it in vSphere.
g

gentle-diamond-70147

05/05/2020, 7:30 PM
Can you share your code for the cluster resource specifically?
g

gentle-soccer-81698

05/05/2020, 7:31 PM
Copy code
## Create vSphere Cluster(s)
cluster_list = []
def create_cluster():
    for x in all_hosts:
        cluster = [x['cluster']]
        for n in cluster:
            compCluster = vsphere.ComputeCluster(resource_name=n, datacenter_id=dc_list[0].moid,name=n,
                drs_enabled = cl_settings["drs_enabled"],
                drs_automation_level=cl_settings["drs_automation_level"],
                ha_enabled = cl_settings["ha_enabled"],
                ha_advanced_options = cl_settings["ha_advanced_options"],
                ha_admission_control_policy = 'disabled')
            x.update(clusterObject = compCluster)
    return cluster_list
create_cluster()
Copy code
cl_settings = {"drs_enabled": True, "drs_automation_level": 'fullyAutomated', "ha_enabled": True, 
               "ha_advanced_options":{'das.IgnoreInsufficientHbDatastore':'True',
               'das.IgnoreRedundantNetWarning':'True'}, "ha_admission_control_policy": 'disabled'}
g

gentle-diamond-70147

05/05/2020, 7:39 PM
You should be able to add it like this:
Copy code
opts=pulumi.ResourceOptions(depends_on=[other_resource])
g

gentle-soccer-81698

05/05/2020, 7:40 PM
UGH! I'm an idiot!
Hmm I think the issue is I'm actually adding the hosts directly into the cluster. So I can't even use dependsOn because the hosts aren't in the vCenter yet. Thanks though the depends_on option that helps future work!
👍 1