Skip to content

Add DatasourceOVF network-config propery to Ubuntu OVF example#1184

Merged
TheRealFalcon merged 2 commits into
canonical:mainfrom
megian:ovf-example-network-config
Jan 18, 2022
Merged

Add DatasourceOVF network-config propery to Ubuntu OVF example#1184
TheRealFalcon merged 2 commits into
canonical:mainfrom
megian:ovf-example-network-config

Conversation

@megian
Copy link
Copy Markdown
Contributor

@megian megian commented Jan 12, 2022

Cloud-init includes the capability to take the network-config from a
separate key. This removes the need to merge the network config in
the user-data and make it more transparent in some cases.

Reference:

network_props = ["network-config"]

Test Steps

  • Create a template using the OVF example
  • Instantiate a VM from that template
  • Set the property key network-config to
bmV0d29yazoKICB2ZXJzaW9uOiAyCiAgZXRoZXJuZXRzOgogICAgaW50ZXJmYWNlMDoKICAgICAgbWF0Y2g6CiAgICAgICAgbmFtZTogZW5zMTkyCiAgICAgIGFkZHJlc3NlczoKICAgICAgICAtIDE5Mi4xNjguMTAwLjEwMC8yNAogICAgICBnYXRld2F5NDogMTkyLjE2OC4xMDAuMQogICAgICBuYW1lc2VydmVyczoKICAgICAgICBzZWFyY2g6CiAgICAgICAgIC0gZm9vLmxvY2FsCiAgICAgICAgIC0gYmFyLmxvY2FsCiAgICAgICAgYWRkcmVzc2VzOgogICAgICAgICAtIDEuMS4xLjEK
  • Check that if the content has been written to /etc/netplan/50-cloud-init.yaml inside the VM operating system

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly (N/A because it is just an example file)
  • I have updated or added any documentation accordingly (N/A because it is just an example file)

Cloud-init includes the capability to take the network-config from a
separate key. This removes the need to merge the network config in
the user-data and make it more transparent in some cases.

Reference:
https://github.com/canonical/cloud-init/blob/42b938e8ff4c50833ff7b8f5acc1d9ab3f43ab18/cloudinit/sources/DataSourceOVF.py#L557
Copy link
Copy Markdown
Contributor

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

Thanks. I left one inline suggestion.

Comment thread doc/sources/ovf/example/ubuntu-server.ovf Outdated
Co-authored-by: James Falcon <therealfalcon@gmail.com>
@megian megian requested a review from TheRealFalcon January 14, 2022 22:45
Copy link
Copy Markdown
Contributor

@TheRealFalcon TheRealFalcon left a comment

Choose a reason for hiding this comment

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

Thanks!

@TheRealFalcon TheRealFalcon merged commit 45484c0 into canonical:main Jan 18, 2022
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

Successfully merging this pull request may close these issues.

2 participants