vcf_esxi_vlcm

State module for vCenter’s ESX Lifecycle Manager (vLCM) REST API.

Drives ESXi host patching for a vSphere cluster through the desired-image workflow: configure and sync depots, define/commit a desired image, set the cluster’s apply policy, then check compliance and remediate against it.

Depot/image/policy specs default from pillar saltext.vcf:esxi_vlcm when not passed explicitly — see saltext.vcf.clients.esxi_vlcm for the underlying REST calls.

Example:

patch-depot:
  vcf_esxi_vlcm.depot_configured:
    - depot_type: offline
    - location: http://repo.example.com/VMware-ESXi-9.2.0.0.25504872-depot.zip

domain-c9:
  vcf_esxi_vlcm.image_configured:
    - image_spec:
        base_image:
          version: "9.2.0.0.25504872"
    - require:
      - vcf_esxi_vlcm: patch-depot
  vcf_esxi_vlcm.remediated:
    - require:
      - vcf_esxi_vlcm.image_configured: domain-c9
saltext.vcf.states.vcf_esxi_vlcm.depot_configured(name, depot_type=None, location=None, source_type=None, enabled=True, description=None, ownerdata=None, profile=None, **kwargs)[source]

Ensure a depot supplying ESXi update payloads is configured.

depot_type is "offline" (a downloadable ZIP bundle at location, the common case) or "online" (a VMware/vendor update repository URL, also passed as location). Idempotent: no-op if a depot pointing at the same location already exists.

saltext.vcf.states.vcf_esxi_vlcm.depot_synced(name, profile=None, **kwargs)[source]

Trigger a depot sync so ESXi update payloads are up to date.

Not idempotent — there’s no cheap way to tell “already synced” apart from “sync never needed,” so this always fires the sync action. Some vCenter builds don’t expose the sync action at all (404); that’s treated as a no-op, not a failure.

saltext.vcf.states.vcf_esxi_vlcm.image_configured(name, cluster_id=None, image_spec=None, display_name=None, existing_draft_action='delete', validate=True, commit=True, commit_message=None, profile=None, **kwargs)[source]

Ensure the cluster’s desired image matches image_spec.

Idempotent on the committed image’s base_image.version. If a draft already exists on the cluster, existing_draft_action controls what happens: "fail" raises, "delete" (default) discards it and proceeds, "reuse" uses it as-is provided its base image version already matches image_spec.

After commit, re-reads the desired image and verifies the version landed as requested — a commit that reports success but doesn’t move the version is treated as a failure.

saltext.vcf.states.vcf_esxi_vlcm.policy_configured(name, cluster_id=None, policy_spec=None, profile=None, **kwargs)[source]

Ensure the cluster’s apply policy matches policy_spec.

Idempotent on the subset of keys present in policy_spec — only those keys are compared against the current policy, so extra fields vCenter populates on its own don’t cause a spurious “changed” every run.

saltext.vcf.states.vcf_esxi_vlcm.compliance_checked(name, cluster_id=None, commit='1', hosts=None, profile=None, **kwargs)[source]

Scan the cluster for compliance against its desired image.

Always runs — there’s no cheap “already compliant” signal to check beforehand; use reported() to inspect the result afterward.

saltext.vcf.states.vcf_esxi_vlcm.prechecked(name, cluster_id=None, commit='1', profile=None, **kwargs)[source]

Run remediation prechecks on the cluster. Always runs (see compliance_checked()).

saltext.vcf.states.vcf_esxi_vlcm.staged(name, cluster_id=None, commit='1', hosts=None, profile=None, **kwargs)[source]

Stage the desired image on cluster hosts. Always runs (see compliance_checked()).

saltext.vcf.states.vcf_esxi_vlcm.remediated(name, cluster_id=None, accept_eula=True, profile=None, **kwargs)[source]

Remediate (apply the desired image to) the cluster.

Always runs (see compliance_checked()). Unlike compliance_checked()/staged(), remediation has no hosts filter — it always targets the whole cluster.

saltext.vcf.states.vcf_esxi_vlcm.reported(name, cluster_id=None, profile=None)[source]

Fetch the cluster’s last check/apply-impact/apply reports.

Always a no-op read (changed=False) — the reports are surfaced in comment only; use the corresponding saltext.vcf.modules.vcf_esxi_vlcm functions to consume the full payloads programmatically.