The Salt Appliance

How to use the Salt Appliance OVA

v0.10.0

SpecificationDetails
Salt Appliance Description & Location-Placeholder URL-
Appliance Profile1 vCPU
2GB Memory
16GB Hard disk
1 NIC
VM version 15
Dependencies• vSphere 9 & above vCenter and ESX Hosts (tested)
• One IPv4 address
• Network connectivity to 9.x VMware appliances
• One or more 9.x VMware appliances
• Administrative username and password to each VMware Appliance

The basic overview

  1. Deploy the OVA
  2. Login
  3. VMware appliance credentials input
  4. Review sample Salt state files (provide specific functionality)
  5. Run Salt commands to perform the task.

Step by Step

1. Deploy the OVA

Deploy the OVA in your environment with the defaults. It needs an IP that can reach the VMware appliances you want to reach. It will pick up a dynamic IP by default so change it to a static one if you need to.

2. Login

  1. Credentials are username: root with password: shessalty. You will be prompted to change the password upon successful login.
  2. It is highly recommended that you run tdnf update to update the Photon OS with the latest patches.
  3. Salt Master 3008.2, Salt Minion 3008.2, and the Salt Extensions for VCF are already installed. You can check the Salt version by running the following commands:
    • salt-master --version
    • salt-minion --version
  4. Two directories that are required by Salt Master were created:
    • /srv/pillar — in this example use case, this directory will hold the credentials to your target VCF Appliances.
    • /srv/salt — this is the default location where Salt Master holds the Salt State files. Salt state files are text based files where you document your desired values for configuration settings (for this example).

You can navigate into those directories to view the example files that have been created for your use. You will need to edit those files for your environment next.

3. Modify the sample default files with your VMware appliance credentials

Navigate to /srv/pillar and view the example files:

FileDescription
vcfcredentialspillar.slsThis system is designed to use this file as the default file containing credentials to your VCF environment. You will edit this file in order to configure Salt to access your VCF appliances.
vcfcredentialspillar-reference.slsIf you are unsure of any changes in the default vcfcredentialspillar.sls file, you can refer to this file for reference.
vcfcredentialspillar-EXAMPLE.slsDuring my testing, besides the actual password, these were the settings I used to successfully use Salt with my VCF instance.

All example files provided in /srv/pillar and /srv/salt adhere to Salt’s required formatting and syntax. If you deviate from this format, Salt will not be able to parse, read, and use the file.

Edit the vcfcredentialspillar.sls file and add the username and password to the VCF components you would like to target. Comment out any components you do not intend to use.

Here is an example of the contents of the vcfcredentialspillar.sls file:

saltext.vcf:
  vcenter:
    host: myfqdn.myorg.com
    username: administrator@vsphere.local
    password: yourpasswordhere
    verify_ssl: false

  sddc_manager:
    host: myfqdn.myorg.com
    username: administrator@vsphere.local
    password: yourpasswordhere
    verify_ssl: false

  nsx:
    host: myfqdn.myorg.com
    username: admin
    password: yourpasswordhere
    verify_ssl: false

  vcf_ops:
    host: myfqdn.myorg.com
    username: admin
    password: yourpasswordhere
    verify_ssl: false

Please keep in mind that this ova and the Salt components in this installation are designed to use the credentials outlined in the vcfcredentials.sls file. If you use a different credential for the appliances, they may not work.

Important: It is recommended that you issue the following command in order to ensure the Salt system is refreshed to use your credentials:

salt-call saltutils.pillar_refresh

*Important Note: It is recommended to encrypt any files you store sensitive credentials or important data. Since this system is being offered as a proof of concept for functionality, clear text files are being used to reduce the complexity of the environment.

4. Review sample Salt state files

Modify the sample Salt state files that contain the settings you want to monitor for.

All example files provided in /srv/pillar and /srv/salt adhere to Salt’s required formatting and syntax. If you deviate from this format, Salt will not be able to parse, read, and use the file.

Navigate to /srv/salt and review the sample files included:

FileDescription
checkpwexpire_AllVCF.slsThis state file will return all local accounts on VCF with passwords that will expire within 90 days. The expiration length of 90 days is modifiable in the file. This file will only return the requested data.
dns_VC.slsThis file will compare the dns server setting in vcenter against the dns server listed in this file (8.8.8.8 is in the file as a default). This file will tell you whether the target vcenter is using the designated dns server. This file can also apply the dns server setting on vCenter if it does not match the dns setting in the file.
list_local_users_ALL_VCF.slsThis file will return all local users from all VCF appliances. This file will only return the requested data.
list_local_users_NSX.slsThis file will return all local users from NSX appliances. This file will only return the requested data.
list_local_users_VC.slsThis file will return all local users from vCenter appliances. This file will only return the requested data.

These sample Salt state files are intentional in their simplicity and are meant to demonstrate the basic Salt constructs needed to perform operational VCF Tasks. Salt is capable of significantly more complex logic via the Salt state files, jinja files, top files, etc. However, the more advanced Salt capabilities are beyond the scope of this post.

5. Run Salt commands to perform the task

Execute a Salt state file to perform the designated task in the state file.

FileCommands
checkpwexpire_AllVCF.slsAt the command line of the system:
salt '*' state.apply checkpwexpire_AllVCF

If you want to capture the return in a file, direct the return to a file:
salt '*' state.apply checkpwexpire_AllVCF > /tmp/checkpwexpire_AllVCF_output.txt
dns_VC.slsAt the command line of the system:
salt '*' state.apply dns_VC test=True

To update the vCenter's dns settings with what is in the dns_VC.sls file, issue the following command:
salt '*' state.apply dns_VC
list_local_users_ALL_VCF.slsAt the command line of the system:
salt '*' state.apply list_local_users_ALL_VCF

If you want to capture the return in a file, direct the return to a file:
salt '*' state.apply list_local_users_ALL_VCF > /tmp/list_local_users_ALL_VCF_output.txt
list_local_users_NSX.slsAt the command line of the system:
salt '*' state.apply list_local_users_NSX

If you want to capture the return in a file, direct the return to a file:
salt '*' state.apply list_local_users_NSX > /tmp/list_local_users_NSX_output.txt
list_local_users_VC.slsAt the command line of the system:
salt '*' state.apply list_local_users_VC

If you want to capture the return in a file, direct the return to a file:
salt '*' state.apply list_local_users_VC > /tmp/list_local_users_VC_output.txt

If you want to see what else is possible with the modules on the OVA, visit the saltext-vcf page.


Additional Common Tasks

TaskCommand
Getting all VCF appliance certificatesSalt '*' vcf_vcfops_fleet_certificates.list_

If you want to save output to a file:
Salt '*' vcf_vcfops_fleet_certificates.list_ > filename
List accounts in all VCF appliances in your pillarSalt "*" vcf_vcfops_fleet_passwords.query_accounts

If you want to save output to a file:
Salt "*" vcf_vcfops_fleet_passwords.query_accounts > filename
List accounts in vCenters onlySalt "*" vcf_vcfops_fleet_passwords.list_ appliance=VCENTER
List Certs in vCenters OnlySalt '*' vcf_vcfops_fleet_certificates.query_certificates appliance=VCENTER category=TLS_CERT
List certs in NSX Managers OnlySalt '*' vcf_vcfops_fleet_certificates.query_certificates appliance=NSX category=TLS_CERT

Saltext-VCF Module Reference

For reference, here is the saltext-vcf modules partial functionality parsed:

VCF ComponentFunction CategoryIDAction DescriptionSaltext-VCF Module TargetComments / Details
SDDC ManagerDomain Management1.1Create Workload Domainvcf_sddc_domain.createDeploys new workload domains via JSON specification files.
1.2List/Read Domainsvcf_sddc_domain.listRetrieves configuration and health status of all active domains.
1.3Delete/Decommission Domainvcf_sddc_domain.deleteSafely tears down workload domains and releases host inventory.
Host Management2.1Commission ESXi Hostsvcf_sddc_host.commissionValidates and introduces physical/virtual hosts into SDDC inventory.
2.2Decommission ESXi Hostsvcf_sddc_host.decommissionCleans configurations and safely unbinds hosts from the SDDC pool.
Lifecycle & Secrets3.1Manage Network Poolsvcf_sddc_network.pool_manageAutomates VTEP, vMotion, and vSAN IP pool allocations.
3.2Password Rotationvcf_sddc_credentials.rotateTriggers automated rotation of system and service passwords.
vCenter ServerDatacenters & Clusters4.1Create Datacentervcf_vcenter_datacenter.createInitializes root Datacenter inventory objects.
4.2Manage Cluster Configurationsvcf_vcenter_cluster.manageEnforces HA, DRS, and EVC settings across host clusters.
Virtual Networking5.1Create Distributed Switches (vDS)vcf_vcenter_network.vds_createPrograms virtual distributed switches globally.
5.2Configure Port Groupsvcf_vcenter_network.portgroup_manageDefines VLAN bindings, teaming policies, and active uplinks.
Virtual Machines6.1Deploy/Clone VMvcf_vcenter_vm.deployProvisions VMs from templates using customization specs.
6.2Manage VM Statevcf_vcenter_vm.powerAsserts execution states (Power On, Off, Soft Reboot).
NSXGateway Routing7.1Configure Tier-0 Gatewayvcf_nsx_t0.manageEstablishes top-tier routing interfaces and physical peerings.
7.2Configure Tier-1 Gatewayvcf_nsx_t1.manageSets up tenant-isolated segment gateways linked to Tier-0.
Logical Networking8.1Create Segmentvcf_nsx_segment.createPrograms overlays and VLAN logical segments.
8.2Delete Segmentvcf_nsx_segment.deleteTears down segment networks when empty.
Security9.1Configure DFW Rulesvcf_nsx_security.dfw_policyOrchestrates stateful distributed firewall rules system-wide.
vSANStorage Architecture10.1Enable vSAN Clustervcf_vsan.cluster_configureEnforces vSAN cluster configuration and storage profiles.
10.2Manage Disk Groupsvcf_vsan.disk_group_manageClaims local cache and capacity drives per host.
10.3Fault Domain Routingvcf_vsan.fault_domain_configOrganizes rack and host fault boundaries.
Integrity11.1Verify Storage Healthvcf_vsan.health_checkQueries vSAN SOAP health interfaces directly.
ESXi HostHost Configuration12.1NTP & Syslog Configvcf_esxi.sys_configEnforces atomic infrastructure time and logging targets.
12.2Advanced Host Settingsvcf_esxi.advanced_configSets security, kernel parameters, and lockouts.
Storage13.1Mount NFS/VMFS Datastorevcf_esxi.datastore_manageConnects file-based or block-based storage platforms.
VCF OperationsFleet Analytics14.1Deploy Operations Nodevcf_vcfops_deployment.deployProvisions/scales Aria Operations cluster elements.
14.2Check Deployment Healthvcf_vcfops_deployment.healthyConfirms active cluster health metrics.
VMSPMediated Access15.1Configure Multi-Tenant Gatewayvcf_vmsp.access_controlSets up secure proxying and client credential boundaries.

Update the VCF capabilities with newly contributed functionality (modules, etc.) by issuing the following command to pull down the latest update:

salt-pip install -U saltext-vcf

Authors:
Frances Wong, Salt PM
Rob Robertson, Field Application Engineer
Derek Ardolf, Software Engineer