f8d3cbdd59
Add the FastAPI app, PostgreSQL migrations, Docker/Helm packaging, API contracts, docs, client examples, and the unit/integration/compatibility test suite for local client and tooling labs without a real vCenter.
3.1 KiB
3.1 KiB
Language / Язык: English | Русский
Clients
Use the simulator from common VMware automation stacks: Python, Ansible, Terraform, Pulumi.
Connection matrix
| Stack | Transport | Notes | Code |
|---|---|---|---|
| REST (curl / SDK) | HTTPS :443 |
vmware-api-session-id after Basic session |
examples/python/vsphere_rest_smoke.py, vsphere_lifecycle.py |
| SOAP / VIM | HTTPS :443/sdk |
pyvmomi / govmomi / Terraform / Pulumi providers | examples/python/vsphere_soap_smoke.py |
Legacy /rest |
HTTPS :443 |
{ "value": … } wrappers |
/rest/vcenter/vm |
| Terraform | HTTPS :443 |
hashicorp/vsphere data sources + optional VM resource |
examples/terraform/vsphere/ |
| Ansible | HTTPS :443 |
REST lifecycle playbook (uri module) |
examples/ansible/vsphere_playbook.yml |
| Pulumi | HTTPS :443 |
REST ComponentResource cookbook | examples/pulumi/ |
| govc | HTTPS :443 |
GOVC_URL=https://… insecure |
see below |
| Go / Java / Perl | HTTPS :443 |
Minimal REST cookbooks (Basic-auth session) | examples/go/, examples/java/, examples/perl/ |
Credentials (seed)
| User | Password | Role |
|---|---|---|
administrator@vsphere.local |
VMware1! |
Administrator |
readonly@vsphere.local |
VMware1! |
ReadOnly |
operator@vsphere.local |
VMware1! |
VirtualMachinePowerUser |
vmadmin@vsphere.local |
VMware1! |
VirtualMachineAdministrator |
Inventory seed
make seed # large: 10 hosts / 1000 VMs
VSPHERE_PROFILE=demo-cluster make seed
VSPHERE_PROFILE=small make seed
Quick cookbooks
# All four stacks (Python/Ansible/Terraform/Pulumi-style) inside Compose
make client-cookbooks
# Python REST + SOAP CreateVM / NFC
VSPHERE_BASE=https://localhost python examples/python/vsphere_lifecycle.py
# Ansible
ansible-playbook -i examples/ansible/inventory.ini examples/ansible/vsphere_playbook.yml
# Terraform — hashicorp/vsphere data sources (plan) + optional CreateVM resource
cd examples/terraform/vsphere
terraform init
TF_VAR_vsphere_server=localhost TF_VAR_create_lab_vm=false terraform plan
TF_VAR_vsphere_server=localhost TF_VAR_create_lab_vm=true terraform apply
# Pulumi REST
cd examples/pulumi && pulumi up
Verified against the gateway (:443): Python lifecycle, Ansible playbook, Pulumi-style REST, and terraform plan (datacenter/cluster/datastore/network/VM data sources) are green. SOAP CreateVM_Task is available for the resource path; use a fresh seed if folder names were renamed by probes (make seed).
govc (optional host tool)
export GOVC_URL=https://localhost
export GOVC_USERNAME=administrator@vsphere.local
export GOVC_PASSWORD='VMware1!'
export GOVC_INSECURE=1
govc about
govc ls /
govc find / -type m | head
govc vm.info web-01
pyvmomi smoke
docker compose run --rm --no-deps -e VSPHERE_BASE=http://simulator:8080 \
-e TEST_DATABASE_URL=postgresql://vmware:vmware@postgres:5432/vmware_simulator \
dev pytest tests/compatibility/test_vsphere_pyvmomi.py -q
Per-language guides: examples/overview.md. Coverage: api-coverage.md.