Files
inecs f8d3cbdd59 Initial commit: VMware vSphere API simulator scaffold.
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.
2026-07-18 04:42:11 +03:00

33 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
**Language / Язык:** [English](../../examples/terraform.md) | [Русский](terraform.md)
# Terraform
[`examples/terraform/vsphere/`](../../../examples/terraform/vsphere/) использует
официальный провайдер `hashicorp/vsphere` (SOAP `/sdk` под капотом), направленный
на локальный HTTPS-шлюз (`https://localhost`) с
`allow_unverified_ssl = true` для разработческого сертификата.
```bash
cd examples/terraform/vsphere
terraform init
TF_VAR_create_lab_vm=false terraform plan # только data sources (datacenter/cluster/datastore/network/VM)
TF_VAR_create_lab_vm=true terraform apply # также создаёт лабораторную ВМ (SOAP CreateVM_Task)
```
Значения по умолчанию (`variables.tf`): `vsphere_server = "localhost"`,
`vsphere_user = "administrator@vsphere.local"`,
`vsphere_password = "VMware1!"`, `datacenter = "Datacenter"`,
`cluster = "Cluster"`, `datastore = "datastore1"`,
`network = "VM Network"`, `vm_name = "web-01"` (ВМ из seed `small`/`large`).
Версии плагинов провайдера меняются быстро — закрепите версии в блоке
`required_providers` под то, что вы протестировали. После `make seed` обновите
или пересоздайте state, чтобы допущения об именах ВМ/MOID оставались согласованными.
Этот cookbook — отправная точка для лабораторного CI, а не сертификация каждого
resource/data source `hashicorp/vsphere` против полного реестра маршрутов. См.
[SOAP / VIM](../domains/soap.md) для точных операций, лежащих в основе create/read
путей провайдера, и
[`pulumi-tests/`](../../../pulumi-tests/README.ru.md) для lab-набора
`pulumi-vsphere` (`make pulumi-tests`).