vmware.vsphere.cluster¶
- vmware.vsphere.cluster.get(attr_name, attr_value, obj, **kwargs):
Get a specific cluster identified by an attribute. Will only return the first object that matches
- Parameters:
attr_name – Name of the attribute that shall be used for selecting the object. Can also be “rel_path” to match a specific path within a folder-structure. Be aware, that this will trigger a ‘get_dict’ which may take a while.
attr_value – Value which attr_name must contain
obj (object) – The object within we shall search for clusters (datacenter or folder)
- Returns:
First object that matched the selection. Returns bool:False if no match was found
- Return type:
object
- Keyword Arguments:
vc_obj (
object) vCenter-object that was created by vmware.vsphere.get_content(). This will overwrite the object that was registered as default by vmware.vsphere.default()
- vmware.vsphere.cluster.get_datastore_clusters(obj):
Get a list of all datastore-clusters in the cluster
- Parameters:
obj (object) – The cluster-object
- Returns:
List of objects
- Return type:
list
- vmware.vsphere.cluster.get_datastores(obj):
Get a list of all datastores in the cluster
- Parameters:
obj (object) – The cluster-object
- Returns:
List of objects
- Return type:
list
- vmware.vsphere.cluster.get_dict(obj, **kwargs):
Get all clusters beneath the object and return a dictionary. If neighter “cluster” or “standalone” are explicitly set to True, both are fetched
- Parameters:
obj (object) – The object within we shall search for clusters (datacenter or folder)
- Returns:
Dictionary containing a key -> value pair per cluster
- Return type:
dict
- Keyword Arguments:
key (
string) String containing the attribute-name that shall be used as the dictionary-key. May be “rel_path” to construct a relative path, which is descriptive and unique containing all the folders (default). Make sure to choose a unique attribute, otherwise elements will overwrite each other.cluster (
bool) Get clustersstandalone (
bool) Get standalone hosts (“single clusters”)
- vmware.vsphere.cluster.get_hosts(obj):
Get a list of all hosts in the cluster
- Parameters:
obj (object) – The cluster-object
- Returns:
List of objects
- Return type:
list
- vmware.vsphere.cluster.get_list(obj, **kwargs):
Get all clusters beneath the object and return a list. If neighter “cluster” or “standalone” are explicitly set to True, both are fetched. This function is much faster than get_dict() when the vCenter-object is present (passed within kwargs or present as default)
- Parameters:
obj (object) – The object within we shall search for clusters (datacenter or folder)
- Returns:
List of objects
- Return type:
list
- Keyword Arguments:
cluster (
bool) Get clustersstandalone (
bool) Get standalone hosts (“single clusters”)vc_obj (
object) vCenter-object that was created by vmware.vsphere.get_content(). This will overwrite the object that was registered as default by vmware.vsphere.default()
- vmware.vsphere.cluster.get_respools(obj):
Get a list of all resource-pools in the cluster
- Parameters:
obj (object) – The cluster-object
- Returns:
List of objects
- Return type:
list
- vmware.vsphere.cluster.is_cluster(obj):
Check if passed object is a cluster
- Parameters:
obj (object) – The object
- Returns:
True if it is a cluster, false if not
- Return type:
bool
- vmware.vsphere.cluster.is_type(obj):
Check if passed object is a cluster
- Parameters:
obj (object) – The object
- Returns:
True if it is a cluster, false if not
- Return type:
bool