salt.states.pbm#
Manages VMware storage policies (called pbm because the vCenter endpoint is /pbm)
Examples
Storage policy#
{
"name": "salt_storage_policy"
"description": "Managed by Salt. Random capability values.",
"resource_type": "STORAGE",
"subprofiles": [
{
"capabilities": [
{
"setting": {
"type": "scalar",
"value": 2
},
"namespace": "VSAN",
"id": "hostFailuresToTolerate"
},
{
"setting": {
"type": "scalar",
"value": 2
},
"namespace": "VSAN",
"id": "stripeWidth"
},
{
"setting": {
"type": "scalar",
"value": true
},
"namespace": "VSAN",
"id": "forceProvisioning"
},
{
"setting": {
"type": "scalar",
"value": 50
},
"namespace": "VSAN",
"id": "proportionalCapacity"
},
{
"setting": {
"type": "scalar",
"value": 0
},
"namespace": "VSAN",
"id": "cacheReservation"
}
],
"name": "Rule-Set 1: VSAN",
"force_provision": null
}
],
}
Dependencies#
pyVmomi Python Module
pyVmomi#
PyVmomi can be installed via pip:
pip install pyVmomi
Note
Version 6.0 of pyVmomi has some problems with SSL error handling on certain versions of Python. If using version 6.0 of pyVmomi, Python 2.6, Python 2.7.9, or newer must be present. This is due to an upstream dependency in pyVmomi 6.0 that is not supported in Python versions 2.7 to 2.7.8. If the version of Python is not in the supported range, you will need to install an earlier version of pyVmomi. See Issue #29537 <https://github.com/saltstack/salt/issues/29537> for more information.
- salt.states.pbm.default_storage_policy_assigned(name, policy, datastore)#
Assigns a default storage policy to a datastore
- policy
Name of storage policy
- datastore
Name of datastore
- salt.states.pbm.default_vsan_policy_configured(name, policy)#
Configures the default VSAN policy on a vCenter. The state assumes there is only one default VSAN policy on a vCenter.
- policy
Dict representation of a policy
- salt.states.pbm.storage_policies_configured(name, policies)#
Configures storage policies on a vCenter.
- policies
List of dict representation of the required storage policies