Advanced VM Build
This page shows a complete VM build request combining all available build-time options: firewall sets, cloud-init with Secrets Manager references, and additional NICs with VLAN assignments. Each feature is independent — use only what you need.
Prerequisites
- Firewall feature enabled on account (for
firewall_set_list) - Cloud VLAN / NIC feature enabled on contract (for
params.nics) - Secrets created in Secrets Manager (for secret references)
- Firewall sets created before the build call
See the individual guides for each feature:
- Building VMs with Firewall Sets
- Building VMs with Cloud-Init
- Building VMs with Multiple NICs and VLANs
- Using Secrets Manager with Cloud-Init
The Complete Build Request
curl -X POST https://vapi2.netactuate.com/api/build \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mbpkgid": 1001,
"location": 12,
"image": 203,
"fqdn": "app01.example.com",
"ssh_key_id": 88,
"package_billing": "monthly",
"package_billing_contract_id": 5005,
"firewall_set_list": [42],
"script_type": "cloud-init",
"script_content": "<base64-encoded cloud-init YAML>",
"params": {
"customer_vlan_id": 2001,
"nics": [
{ "vlan_id": 1234 },
{ "vlan_id": 5678 }
]
}
}'
The Cloud-Init YAML (Before Base64 Encoding)
This example installs packages, writes a config file with secrets, configures a secondary NIC, and starts a service:
#cloud-config
packages:
- nginx
- curl
write_files:
- path: /etc/app/config.env
permissions: '0600'
content: |
DB_PASSWORD=${{secret.DB_PASSWORD}}
API_KEY=${{secret.API_KEY}}
- path: /etc/netplan/99-eth1.yaml
permissions: '0644'
content: |
network:
version: 2
ethernets:
eth1:
addresses:
- 10.0.1.10/24
runcmd:
- netplan apply
- systemctl enable nginx
- systemctl start nginx
- systemctl restart myapp
Parameter Reference
| Parameter | Required | Description |
|---|---|---|
mbpkgid | Yes | VM package ID |
location | Yes | PoP location ID |
image | Yes | OS image ID |
fqdn | Yes | Hostname |
ssh_key_id | Yes | SSH key ID from portal |
package_billing | No | Billing type: monthly or hourly |
package_billing_contract_id | Required for NICs | Contract ID |
firewall_set_list | No | Array of firewall set IDs |
script_type | No | Script format: cloud-init or bash |
script_content | No | Base64-encoded script content |
params.customer_vlan_id | No | VLAN ID for primary NIC |
params.nics | No | Array of additional NIC objects |
params.nics[*].vlan_id | Yes (per NIC) | Cloud VLAN ID |
params.nics[*].dhcp | No | Enable DHCP on this NIC |
Need Help?
If you need assistance, visit our support page.