dtctl virtual-machine create
Usage
dtctl virtual-machine create [flags]
Aliases
c
Description
Create one or more virtual machines. At minimum, provide a name, a flavor (dtctl flavor list), at least one block device (--volume) that boots from an image, and at least one network interface (--network). For access, provide either an --ssh-key-name or a --script.
Example
# Create a VM from an image, on a network, with an SSH key
dtctl virtual-machine create --name web-1 --flavor-id <flavor-id> \
--volume uuid=<image-id>,source_type=image,device_type=disk,volume_size=10,delete_on_termination=true \
--network uuid=<network-id>,primary_ip=auto,port_security_enabled=true \
--ssh-key-name my-key
Flags
| Option | Description |
|---|---|
--count | Number of identical VMs to create in one call (1-50) Default: 1 |
--enable-hot-plug | Enable CPU/RAM hot-plug on the VM Default: false |
--flavor-id, -f | Flavor ID for size (vCPU/RAM); see 'dtctl flavor list' (required) |
--gpu-image | Mark the selected image as a GPU image Default: false |
--name, -n | Name of the virtual machine (required) |
--network, -i | Network interface as key=value (repeatable). Keys: uuid, primary_ip (or 'auto'), secondary_ips, security_groups (ids), port_security_enabled. Example: uuid=<network-id>,primary_ip=auto,port_security_enabled=true (required) |
--script, -s | Provisioning script as key=value: os (linux|windows), username, password, hostname, disable_root. Provide this or --ssh-key-name |
--security-groups, -g | Comma-separated security group names to attach to the VM |
--ssh-key-name, -k | SSH key name to inject (see 'dtctl ssh list'). Provide this or --script |
--user-data, -u | Cloud-init user data to run on first boot |
--volume, -v | Block device mapping as key=value (repeatable). Keys: uuid, source_type (image|volume|blank), device_type (disk|cdrom), destination_type (volume|local), volume_size, volume_type, delete_on_termination. Example: uuid=<image-id>,source_type=image,device_type=disk,volume_size=10,delete_on_termination=true (required) |
Related Commands
| Command | Description |
|---|---|
| dtctl virtual-machine list | List virtual machines |
| dtctl virtual-machine show | Show 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-network | Attach a network interface |
| 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 |