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

multipass ignores cloud init configuration #1404

Closed
Samet-MohamedAmin opened this issue Mar 5, 2020 · 3 comments
Closed

multipass ignores cloud init configuration #1404

Samet-MohamedAmin opened this issue Mar 5, 2020 · 3 comments

Comments

@Samet-MohamedAmin
Copy link

I'm using multipass with hyper-v driver on windows.
I have created VM with multipass with the cloud-init configuration:
multipass launch --name mpass-14 --cpus 2 --mem 2G --disk 20G --cloud-init .\custom-netwosrking.cfg

network:
  ethernets:
    eth0:
      addresses:
      - 172.16.110.<xxx>/24
      gateway4: 172.16.110.1
      nameservers:
        addresses:
        - 127.0.0.53
  version: 2

The problem is that the ip of the newely create VM does not change.
I have tried other configuration from
cloudinit.readthecos.io
but the configuration does not seem to be accepted.

@jasonmccallister
Copy link
Contributor

@Samet-MohamedAmin from first glance, you are missing the required #cloud-config from the top of your file. DO has a really nice tutorial here: https://www.digitalocean.com/community/tutorials/an-introduction-to-cloud-config-scripting.

I'm not too familiar with cloud-init and I find the documentation rather lacking, but I'm pretty sure that you cannot set the IP as it is assigned by the hypervisor on boot and is not user controlled. This ticket has more information on the IP assignment #1293 (comment)

@Saviq
Copy link
Collaborator

Saviq commented Mar 10, 2020

Hi @Samet-MohamedAmin @jasonmccallister hit it exactly. It won't be considered cloud-init data unless it has the #cloud-config header. But also - you can't currently take ownership of the networking, as Multipass relies on it to contact the instances.

When dealing with #118, we'll add a way for you to specify a bridge (or interface) to hook the instance to and you'll be able to use its DHCP or static addresses for those virtual NICs.

@Saviq
Copy link
Collaborator

Saviq commented Mar 10, 2020

Duplicate of #118

@Saviq Saviq marked this as a duplicate of #118 Mar 10, 2020
@Saviq Saviq closed this as completed Mar 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants