You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/explanation/instance_config.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,14 +21,26 @@ Instance options
21
21
22
22
In the YAML configuration, options are located under the `config` entry.
23
23
24
-
See {ref}`instance-options` for a reference of available instance options.
24
+
See {ref}`instance-options` for a reference of available instance options, and {ref}`instances-configure-options` for instructions on how to configure the options.
25
+
26
+
Instance devices
27
+
: Instance devices are attached to an instance.
28
+
They include, for example, network interfaces, mount points, USB and GPU devices.
29
+
Devices are usually added after an instance is created with the `lxc config device add` command, but they can also be added to a profile or a YAML configuration file that is used to create an instance.
30
+
31
+
Each type of device has its own specific set of options, referred to as *instance device options*.
32
+
33
+
In the YAML configuration, devices are located under the `devices` entry.
34
+
35
+
See {ref}`devices` for a reference of available devices and the corresponding instance device options, and {ref}`instances-configure-devices` for instructions on how to add and configure instance devices.
Copy file name to clipboardExpand all lines: doc/howto/instances_configure.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ See the following sections for instructions.
9
9
To store and reuse different instance configurations, use {ref}`profiles <profiles>`.
10
10
```
11
11
12
+
(instances-configure-options)=
12
13
## Configure instance options
13
14
14
15
You can specify instance options when you {ref}`create an instance <instances-create>`.
@@ -31,15 +32,29 @@ Others are updated only when the instance is restarted.
31
32
See the "Live update" column in the {ref}`instance-options` table for information about which options are applied immediately while the instance is running.
32
33
```
33
34
35
+
(instances-configure-devices)=
34
36
## Configure devices
35
37
36
38
To add and configure an instance device for your instance, use the `lxc config device add` command.
37
-
Specify the instance name, a device name, the device type and maybe device options (depending on the {ref}`device type <device-types>`):
39
+
Generally, devices can be added or removed for a container while it is running.
40
+
VMs support hotplugging for some device types, but not all.
41
+
42
+
Specify the instance name, a device name, the device type and maybe device options (depending on the {ref}`device type <devices>`):
See {ref}`devices` for a list of available device types and their options.
42
47
48
+
```{note}
49
+
Every device entry is identified by a name unique to the instance.
50
+
51
+
Devices from profiles are applied to the instance in the order in which the profiles are assigned to the instance.
52
+
Devices defined directly in the instance configuration are applied last.
53
+
At each stage, if a device with the same name already exists from an earlier stage, the whole device entry is overridden by the latest definition.
54
+
55
+
Device names are limited to a maximum of 64 characters.
56
+
```
57
+
43
58
For example, to add the storage at `/share/c1` on the host system to your instance at path `/opt`, enter the following command:
44
59
45
60
lxc config device add my-container disk-storage-device disk source=/share/c1 path=/opt
@@ -48,6 +63,9 @@ To configure instance device options for a device that you have added earlier, u
48
63
49
64
lxc config device set <instance_name> <device_name> <device_option_key>=<device_option_value> <device_option_key>=<device_option_value> ...
50
65
66
+
To remove a device, use the `lxc config device remove` command.
67
+
See `lxc config device --help` for a full list of available commands.
68
+
51
69
## Display instance configuration
52
70
53
71
To display the current configuration of your instance, including writable instance properties, instance options, devices and device options, enter the following command:
0 commit comments