attach-device

Attaches a device to a defined virtual server.

Syntax

Read syntax diagramSkip visual syntax diagram attach-device  --domain <VS>  --file <XML-filename>
Read syntax diagramSkip visual syntax diagram  --live --config --current --persistent
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 device

Example

This example attaches the devices that are defined in device configuration-XML file dev1.xml to the virtual server vserv1.
# virsh attach-device vserv1 dev1.xml
See also Example of a hotplugged device.