vinfra service compute server iface attach
Attach a network to a virtual machine:
usage: vinfra service compute server iface attach [--fixed-ip <ip-address | ip-address= <ip-address>,subnet=<subnet> | ip-version=<ip-version>>] [--spoofing-protection-enable | --spoofing-protection-disable] [--security-group <security-group> | --no-security-groups] --server <server> --network <network> [--mac <mac>]
--fixed-ip <ip-address|ip-address=<ip-address>,subnet=<subnet>|ip-version=<ip-version>>
- Desired IP address and/or subnet. This option can be used multiple times.
--spoofing-protection-enable
- Enable spoofing protection for the network interface
--spoofing-protection-disable
- Disable spoofing protection for the network interface
--security-group <security-group>
- Security group ID or name. This option can be used multiple times.
--no-security-groups
- Do not set security groups
--server <server>
- Virtual machine ID or name
--network <network>
- Network ID or name
--mac <mac>
- MAC address
Example:
# vinfra service compute server iface attach --network myprivnet --fixed-ip 192.168.129.8 --server myvm +---------------------+----------------------------------------+ | Field | Value | +---------------------+----------------------------------------+ | fixed_ip | 192.168.129.8 | | id | 690ed3f2-2301-40e2-879a-126db2ecb57b | | mac_address | fa:16:3e:54:59:08 | | network_id | 0710372e-2bdf-4dfe-b413-eb763da37e68 | | security_groups | - 1b919f1b-eb9a-492e-9305-ed98d8b1a4e9 | | spoofing_protection | True | +---------------------+----------------------------------------+
This command attaches the virtual network myprivnet
to the virtual machine myvm
.