Hi all! Pulumi n00b here, but I'm moving right alo...
# general
g
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
Can you share your code for the cluster resource specifically?
g
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
You should be able to add it like this:
Copy code
opts=pulumi.ResourceOptions(depends_on=[other_resource])
g
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