Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: Add CLI examples for more device types #13152

Merged
merged 2 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/.sphinx/spellingcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ matrix:
- img
- a.p-navigation__link
- kbd
- strong.command
20 changes: 12 additions & 8 deletions doc/reference/devices_infiniband.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ LXD supports two different kinds of network types for InfiniBand devices:
Therefore, you must pre-configure the number of virtual functions by configuring the corresponding kernel module.
```

To create a `physical` `infiniband` device, use the following command:

lxc config device add <instance_name> <device_name> infiniband nictype=physical parent=<device>

To create an `sriov` `infiniband` device, use the following command:

lxc config device add <instance_name> <device_name> infiniband nictype=sriov parent=<sriov_enabled_device>

## Device options

`infiniband` devices have the following device options:
Expand All @@ -38,3 +30,15 @@ To create an `sriov` `infiniband` device, use the following command:
:start-after: <!-- config group device-infiniband-device-conf start -->
:end-before: <!-- config group device-infiniband-device-conf end -->
```

## Configuration examples

Add a `physical` `infiniband` device to an instance:

lxc config device add <instance_name> <device_name> infiniband nictype=physical parent=<device>

Add an `sriov` `infiniband` device to an instance:

lxc config device add <instance_name> <device_name> infiniband nictype=sriov parent=<sriov_enabled_device>

See {ref}`instances-configure-devices` for more information.
8 changes: 8 additions & 0 deletions doc/reference/devices_none.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ Its only purpose is to stop inheriting devices that come from profiles.
To do so, add a device with the same name as the one that you do not want to inherit, but with the device type `none`.

You can add this device either in a profile that is applied after the profile that contains the original device, or directly on the instance.

## Configuration examples

Add a `none` device to an instance:

lxc config device add <instance_name> <device_name> none

See {ref}`instances-configure-devices` for more information.
10 changes: 10 additions & 0 deletions doc/reference/devices_pci.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,13 @@ In theory, you can also use them for more advanced PCI devices like GPUs or netw
:start-after: <!-- config group device-pci-device-conf start -->
:end-before: <!-- config group device-pci-device-conf end -->
```

## Configuration examples

Add a `pci` device to a virtual machine by specifying its PCI address:

lxc config device add <instance_name> <device_name> pci address=<pci_address>

To determine the PCI address, you can use {command}`lspci`, for example.

See {ref}`instances-configure-devices` for more information.
12 changes: 12 additions & 0 deletions doc/reference/devices_tpm.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,15 @@ For virtual machines, TPM can be used both for sealing certificates and for vali
:start-after: <!-- config group device-tpm-device-conf start -->
:end-before: <!-- config group device-tpm-device-conf end -->
```

## Configuration examples

Add a `tpm` device to a container by specifying its path and the resource manager path:

lxc config device add <instance_name> <device_name> tpm path=<path_on_instance> pathrm=<resource_manager_path>

Add a `tpm` device to a virtual machine:

lxc config device add <instance_name> <device_name> tpm

See {ref}`instances-configure-devices` for more information.
10 changes: 10 additions & 0 deletions doc/reference/devices_usb.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ When a device is passed to the instance, it vanishes from the host.
:start-after: <!-- config group device-unix-usb-device-conf start -->
:end-before: <!-- config group device-unix-usb-device-conf end -->
```

## Configuration examples

Add a `usb` device to an instance by specifying its vendor ID and product ID:

lxc config device add <instance_name> <device_name> usb vendorid=<vendor_ID> productid=<product_ID>

To determine the vendor ID and product ID, you can use {command}`lsusb`, for example.

See {ref}`instances-configure-devices` for more information.
Loading