Can I pass network configuration using cloud-init?
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.
Hi @codecowboy,
Multipass should work with any user-data module described by the cloud-init docs. Since cloud-init handles network configuration and user-data separately I don't believe it is possible. As you guessed, the networking side is mostly baked into the application.
@codecowboy If you want to know how I configure network inside multipass using cloud-init, take a look at my code:
https://github.com/Fred78290/autoscaled-masterkube-multipass/blob/main/bin/plateform/multipass/plateform.sh
This should be better documented.