dtctl virtual-machine attach-network
Usage
dtctl virtual-machine attach-network [flags]
Aliases
an
Description
Attach a new network interface to a virtual machine on the given network, assigning a primary IP (or 'auto') and optional secondary IPs and security groups.
Example
dtctl virtual-machine attach-network --vm-id <vm-id> --network-id <network-id> --primary-ip auto
Flags
| Option | Description |
|---|---|
--mac-address, -m | MAC address for the interface (optional) |
--network-id, -n | ID of the network to attach (required) |
--port-security-enabled, -p | Enable port security on the interface Default: true |
--primary-ip, -a | Primary IP address, or 'auto' to assign one automatically (required) |
--secondary-ips, -s | Comma-separated secondary IPs, or 'auto' for automatic assignment |
--security-groups, -g | Comma-separated security group IDs to apply to the interface |
--vm-id, -i | ID of the virtual machine (required) |
Related Commands
| Command | Description |
|---|---|
| dtctl virtual-machine list | List virtual machines |
| dtctl virtual-machine show | Show a virtual machine |
| dtctl virtual-machine create | Create a virtual machine |
| dtctl virtual-machine update-name | Rename a virtual machine |
| dtctl virtual-machine update-network | Update a network interface |
| dtctl virtual-machine delete | Delete a virtual machine |
| dtctl virtual-machine action | Perform a power/lifecycle action |
| dtctl virtual-machine attach-new-volume | Create and attach a new volume |
| dtctl virtual-machine attach-volume | Attach an existing volume |
| dtctl virtual-machine console | Get a VM's remote console URL |
| dtctl virtual-machine detach-network | Detach a network interface |
| dtctl virtual-machine detach-volume | Detach a volume |
| dtctl virtual-machine history | Show a VM's action history |
| dtctl virtual-machine history-details | Show one history entry |
| dtctl virtual-machine hot-plug | Enable or disable hot-plug |
| dtctl virtual-machine networks | List a VM's network interfaces |
| dtctl virtual-machine volumes | List a VM's attached volumes |
Global Flags
| Option | Description |
|---|---|
--api-url | Send this command to a different API endpoint, e.g. a test environment (default "https://console.dt.net.tr/api/v1") |
--config, -c | Specify a custom config file Default: ~/.config/dtctl/config.yaml |
--no-headers | Omit the column headers, for scripting Default: false |
--output, -o | Output format: text, wide, vertical, json. text fits the terminal, wide never truncates, vertical prints one field per line Default: text |