attach-device
Attaches a device to a defined virtual server.
Syntax
Where:- <VS>
- Is the name, the ID, or the UUID of the virtual server.
- <XML-filename>
- Is the name of the XML file, which defines the device to be attached to the running virtual server.
Selected options
- --config
- Persistently attaches the device to the virtual server with the next restart.
- --current
- Depending on the virtual server state:
- running, paused
- Attaches the device to the virtual server until it is detached or the virtual server is terminated.
- shut off
- Persistently attaches the device to the virtual server with the next restart.
- --domain
- Specifies the virtual server.
- --file
- Specifies the device configuration-XML file.
- --live
- Attaches the device to the running virtual server until it is detached or the virtual server is terminated.
- --persistent
- Depending on the virtual server state:
- running, paused
- Attaches the device to the virtual server.
The device remains persistently attached across restarts.
- shut off
- Persistently attaches the device to the virtual server with the next restart.
Usage
Attaching a deviceExample
This example attaches the
devices that are defined in device configuration-XML file dev1.xml to
the virtual server vserv1.
See
also Example of a hotplugged device.# virsh attach-device vserv1 dev1.xml
