canonical/multipass

Can I pass network configuration using cloud-init?

Open

#3.947 aberto em 21 de fev. de 2025

Ver no GitHub
 (5 comments) (1 reaction) (0 assignees)C++ (634 forks)batch import
cloud-initdocumentationhelp wantedlow hanging fruitmedium

Métricas do repositório

Stars
 (6.956 stars)
Métricas de merge de PR
 (Mesclagem média 16d 2h) (50 fundiu PRs em 30d)

Description

The cloud-init docs state:

You can pass the user-data file to Multipass and launch a Bionic instance named test-vm with the following command:

multipass launch bionic --name test-vm --cloud-init user-data
Multipass will validate the user-data configuration file before starting the VM. This breaks all cloud-init configuration formats except the user-data cloud-config.

But if I try to include network config in a user-data file I get:

Error: Cloud config schema errors: network: Additional properties are not allowed ('network' was unexpected),

I would be grateful if someone could let me know whether what I am trying to do is even possible with the multipass implementation of cloud-init? Does the statement 'this breaks all cloud-init configuration formats except...' mean that this isn't possible?

My use case is that I am trying to use cloud-init with ubuntu on a raspberry pi and am having issues with network configuration. I decided to try multipass to see if I could debug the issue locally without juggling sd cards. I'm finding all the docs to be pretty vague and unhelpful.

I also tried providing a list of files to multipass (a separate network-config file) but this also didn't work.

I'm guessing that the networking side of multipass vms is baked in to the application to enable host->vm networking but would be grateful if someone could confirm.

Guia do colaborador