Skip to main content

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:

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

ParameterRequiredDescription
mbpkgidYesVM package ID
locationYesPoP location ID
imageYesOS image ID
fqdnYesHostname
ssh_key_idYesSSH key ID from portal
package_billingNoBilling type: monthly or hourly
package_billing_contract_idRequired for NICsContract ID
firewall_set_listNoArray of firewall set IDs
script_typeNoScript format: cloud-init or bash
script_contentNoBase64-encoded script content
params.customer_vlan_idNoVLAN ID for primary NIC
params.nicsNoArray of additional NIC objects
params.nics[*].vlan_idYes (per NIC)Cloud VLAN ID
params.nics[*].dhcpNoEnable DHCP on this NIC

Need Help?

If you need assistance, visit our support page.