Salt Resources Framework¶
Each minion can publish multiple addressable instances of a managed component as Salt resources. Operators then target subsets by grain.
The Resources framework requires salt.utils.resources. On builds
without it, the saltext.vcf.resources subpackage is dormant
(__virtual__ returns False); use the flat-pillar config from
Configuration instead.
Types¶
Type |
One resource per |
Pillar key |
|---|---|---|
|
vCenter Server |
|
|
SDDC Manager |
|
|
NSX Manager |
|
|
VCF Operations appliance |
|
|
Standalone ESXi host |
|
|
Virtual machine (references a |
|
Pillar¶
resources:
vcenter:
instances:
mgmt-vc:
host: mgmt-vc.example.com
username: administrator@vsphere.local
password: secret
verify_ssl: false
prod-vc:
host: prod-vc.example.com
username: administrator@vsphere.local
password: other-secret
verify_ssl: false
sddc:
instances:
sddc-mgmt:
host: sddc-manager.example.com
username: administrator@vsphere.local
password: secret
verify_ssl: false
nsx:
instances:
mgmt-nsx:
host: mgmt-nsx.example.com
username: admin
password: secret
verify_ssl: false
vcf_ops:
instances:
ops-prod:
host: ops.example.com
username: admin
password: secret
auth_source: LOCAL
verify_ssl: false
Targeting¶
Each resource publishes resource_type, resource_id, and host as
grains, plus type-specific live fields (e.g. name, power_state for
vcf_vm).
# Minions managing vCenter resource 'mgmt-vc'
salt -C 'T@vcenter:mgmt-vc' vcf_vcenter_cluster.list_
# VMs labeled tier=production
salt -G 'tier:production' vcf_vm.power_off
# VMs labeled app=web (across every minion's vCenters)
salt -G 'app:web' vcf_vm.snapshot_create name=before-deploy
vcf_vm resource¶
Each entry references a vcenter instance by id; one minion can
manage VMs across multiple vCenters.
resources:
vcenter:
instances:
mgmt-vc:
host: mgmt-vc.example.com
username: administrator@vsphere.local
password: secret
vcf_vm:
instances:
web-prod-01:
vcenter: mgmt-vc
moid: vm-1234
labels:
tier: production
app: web
db-prod-01:
vcenter: mgmt-vc
moid: vm-1289
labels:
tier: production
app: postgres
labels: entries become top-level grains. Live grains pulled from
vCenter at grains(): name, power_state, cpu_count,
memory_size_MiB.
Per-resource operations:
Function |
Notes |
|---|---|
|
Full VM record |
|
Current power state string |
|
Power control |
|
Snapshot tree |
|
Lifecycle (SOAP) |
|
vCenter tag association |
VM auto-discovery from vCenter (phase 10b) is deferred pending
discover() pagination in the Resources framework.
VKS handoff¶
The Supervisor cluster’s Kubernetes API is consumed via
saltext-kubernetes. After
vcf_vks.fetch_kubeconfig(<cluster_id>):
resources:
kubernetes:
instances:
supervisor-prod:
kubeconfig: /home/salt/.kube/vks-cluster-domain-c9.config
See VKS Bridge.