Skip to main content

Building VMs with Multiple NICs and VLANs

NetActuate VMs support additional network interfaces (NICs) configured with Cloud VLANs at build time. Use this to attach VMs directly to private Layer 2 networks during provisioning — no post-build reconfiguration required.

Prerequisites

  • Cloud VLAN feature and NIC feature must be enabled on your contract. Contact support to enable them.
  • Cloud VLANs must be created before the build call. See Cloud VLANs.
  • Requires package_billing_contract_id in the build call.

VLAN IDs

Find your Cloud VLAN IDs in the portal under Platform > Cloud VLANs. Each VLAN has a global VLAN ID assigned by NetActuate.

Attaching VLANs at Build Time

Pass additional NICs in params.nics. Each entry requires a vlan_id. The primary NIC (eth0) VLAN can optionally be set via params.customer_vlan_id.

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,
"params": {
"customer_vlan_id": 2001,
"nics": [
{ "vlan_id": 1234 },
{ "vlan_id": 5678 }
]
}
}'

Parameter Reference

ParameterTypeDescription
params.customer_vlan_idintegerVLAN ID for the primary NIC (eth0)
params.nicsarrayAdditional NICs beyond eth0
params.nics[*].vlan_idintegerCloud VLAN ID to assign to this NIC
params.nics[*].dhcpbooleanEnable DHCP on this NIC (optional)

Note: Secondary NICs appear as eth1, eth2, and so on inside the VM. Configure IP addressing via cloud-init or post-boot configuration. Use dhcp: true to enable DHCP on a NIC if your VLAN has a DHCP server.

Combining VLANs with Cloud-Init

Use cloud-init to configure the secondary NIC at boot:

#cloud-config
write_files:
- path: /etc/netplan/99-eth1.yaml
permissions: '0644'
content: |
network:
version: 2
ethernets:
eth1:
addresses:
- 10.0.1.10/24

runcmd:
- netplan apply

See Building VMs with Cloud-Init for the full cloud-init workflow.

Need Help?

If you need assistance, visit our support page.