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 UI instructions to instance how-tos #13423

Merged
merged 12 commits into from
May 3, 2024
Merged
49 changes: 46 additions & 3 deletions doc/howto/instances_routed_nic_vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For virtual machines, the gateways must be configured manually or via a mechanis

To configure the gateways with `cloud-init`, firstly initialize an instance:

````{tabs}
`````{tabs}
```{group-tab} CLI
lxc init ubuntu:24.04 my-vm --vm
```
Expand All @@ -23,7 +23,13 @@ To configure the gateways with `cloud-init`, firstly initialize an instance:
"type": "virtual-machine"
}'
```
````{group-tab} UI
```{figure} /images/UI/routed_nic_create_instance.png
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesnt seem routed nic specific, can we re-use this image across different device types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to keep the number of screenshots as low as possible.
The reason I added one here was simply the machine name, to avoid confusion.

But I'll make sure to not use more than needed. :)

:width: 80%
:alt: Create an Ubuntu 24.04 VM
```
````
`````

Then add the routed NIC device:

Expand All @@ -44,9 +50,23 @@ Then add the routed NIC device:
}
}'
```
```{group-tab} UI
You cannot add a routed NIC device through the UI directly.
Therefore, go to the instance detail page, switch to the {guilabel}`Configuration` tab and select {guilabel}`YAML configuration`.
Then click {guilabel}`Edit instance` and add the routed NIC device to the `devices` section.
For example:

devices:
eth0:
ipv4.address: 192.0.2.2
ipv6.address: 2001:db8::2
nictype: routed
parent: my-parent
type: nic
```
````

In this command, `my-parent-network` is your parent network, and the IPv4 and IPv6 addresses are within the subnet of the parent.
In this configuration, `my-parent-network` is your parent network, and the IPv4 and IPv6 addresses are within the subnet of the parent.

Next we will add some `netplan` configuration to the instance using the `cloud-init.network-config` configuration key:

Expand Down Expand Up @@ -93,6 +113,26 @@ Next we will add some `netplan` configuration to the instance using the `cloud-i
}
}'
```
```{group-tab} UI
On the instance detail page, switch to the {guilabel}`Advanced` > {guilabel}`Cloud-init` tab and click {guilabel}`Edit instance`.

Click the {guilabel}`Create override` icon for the {guilabel}`Network config` and enter the following configuration:

network:
version: 2
ethernets:
enp5s0:
routes:
- to: default
via: 169.254.0.1
on-link: true
- to: default
via: fe80::1
on-link: true
addresses:
- 192.0.2.2/32
- 2001:db8::2/128
```
````

This `netplan` configuration adds the {ref}`static link-local next-hop addresses <nic-routed>` (`169.254.0.1` and `fe80::1`) that are required.
Expand All @@ -108,7 +148,7 @@ If there is a `lxdbr0` network on the host, the name server can be set to that I

Before you start your instance, make sure that you have {ref}`configured the parent network <nic-routed-parent>` to enable proxy ARP/NDP.

Then start your instance with:
Then start your instance:

````{tabs}
```{group-tab} CLI
Expand All @@ -117,4 +157,7 @@ Then start your instance with:
```{group-tab} API
lxc query --request PUT /1.0/instances/my-vm/state --data '{"action": "start"}'
```
```{group-tab} UI
Go to the instance list or the respective instance and click the {guilabel}`Start` button (▷).
```
````
Binary file added doc/images/UI/routed_nic_create_instance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.