-
Notifications
You must be signed in to change notification settings - Fork 897
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
Add support for VMware PhotonOS #909
Conversation
@smoser @TheRealFalcon @OddBloke - I have gotten this far with this PR. Need your help to solve the test failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't done a full review because this PR is WIP, but as I was investigating the test issue, I noticed a couple things around networking.
You shouldn't need to provide a separate networkd renderer, as that is already provided by the netplan renderer. Is there something about the netplan renderer that doesn't work for your case? Additionally, you don't need to support both the v1 and the v2 config. If the v2 config works for you, then go with that.
@TheRealFalcon thanks a lot for the input. My tests are passing now. About adding a separate network renderer:
Hope this clarifies at least some of your questions. |
Hi @TheRealFalcon - Can you please review my changes? |
@sshedi , yep, will do! Though probably won't get to it till sometime next week. |
Hi @TheRealFalcon - if you find time, can you please review my changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sshedi We have a good start here. I'll wait to review the test files until we change some of the datasource networking things.
I left some comments inline. In addition to those:
cc_resolv_conf.py:33 : Let's add photon to 'Supported distros' line
I noticed you're setting locale both in the distro and also using cc_resolv_conf.py. Is this intentional? cc_resolv_conf.py isn't run by default. Are the changes to this file needed? If not, ignore my inline comments in that file.
For each new file that has a VMWare copyright line, can you also add a line underneath that says
# This file is part of cloud-init. See LICENSE file for license information.
Thanks for the review comments. I have added the license info to all new files. |
Sorry, I mean resolve_conf, not locale. In your distro, you have code to set the resolve_conf. If the distro is handling that, why do we also need changes to |
Yes but that's inside |
diff --git a/cloudinit/cmd/devel/net_convert.py b/cloudinit/cmd/devel/net_convert.py
index 0668ffa3..5c649fd0 100755
--- a/cloudinit/cmd/devel/net_convert.py
+++ b/cloudinit/cmd/devel/net_convert.py
@@ -11,7 +11,7 @@ from cloudinit.sources import DataSourceAzure as azure
from cloudinit.sources import DataSourceOVF as ovf
from cloudinit import distros, safeyaml
-from cloudinit.net import eni, netplan, network_state, sysconfig
+from cloudinit.net import eni, netplan, networkd, network_state, sysconfig
from cloudinit import log
NAME = 'net-convert'
@@ -51,7 +51,7 @@ def get_parser(parser=None):
parser.add_argument("--debug", action='store_true',
help='enable debug logging to stderr.')
parser.add_argument("-O", "--output-kind",
- choices=['eni', 'netplan', 'sysconfig'],
+ choices=['eni', 'netplan', 'networkd', 'sysconfig'],
required=True,
help="The network config format to emit")
return parser
@@ -118,9 +118,14 @@ def handle_args(name, args):
config['netplan_path'] = config['netplan_path'][1:]
# enable some netplan features
config['features'] = ['dhcp-use-domains', 'ipv6-mtu']
- else:
+ elif args.output_kind == "networkd":
+ r_cls = networkd.Renderer
+ config = distro.renderer_configs.get('networkd')
+ elif args.output_kind == "sysconfig":
r_cls = sysconfig.Renderer
config = distro.renderer_configs.get('sysconfig')
+ else:
+ raise RuntimeError("Invalid output_kind")
r = r_cls(config=config)
sys.stderr.write(''.join([
It'd be helpful to apply a patch like this so I can more easily work/play with the networkd renderer. Even with this change, there will still be a few issues to fix before it works (I'll address those inline), but here is an example of how you could run it: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, you've made some good changes. I haven't been able to fully review everything yet, but this should be plenty for now, and the changes will make it easier for me to try some things.
I have no idea why this is failing https://travis-ci.com/github/canonical/cloud-init/jobs/513191790
The latter has a an extra space at the end of |
Hey @sshedi , I took the liberty of pushing a commit to this branch for the I also removed the if self.uses_systemd():
subp.subp(['systemctl', 'restart', 'systemd-resolved']) The standard systemd-resolved.service runs after systemd-networkd.service, which runs after cloud-init-local.service, which is when this I still need to do the rest of the review. |
No problem, thank you. My idea was giving a bit more freedom in distro specific function by adding new function in distros/init.py. Ultimately resolve conf will be processed in same way. I am okay with this approach and it works for me. Also, good call on restarting resolved service along with networkd. I have fixed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sshedi , thanks for all of the updates. I think we're getting really close here. I left a few more comments inline, but these should be quicker to fix.
Additionally, I'm hoping we can get a few more tests in test_net.py
for the networkd renderer. In particular, if you look at the NETWORK_CONFIGS definition, you'll see a number of different keys, such as small or v4_and_v6. For each key, there's a yaml definition, along with expected_*
definitions for the expected output from each respective renderer. I realize that at this point not every definition in that list will be supported with the current networkd renderer, but it would be nice to have the tests for the ones that do work. Then further below are defined tests that ensure the rendering works as expected.
I put up a PR for the DNS changes here: #923 . I borrowed a little from this PR if that's ok. If that PR lands, you shouldn't need any changes to |
No problem. I have pushed my latest changes and I have added some more tests in test_net.py as you suggested.
I have kept my network_state.py changes, if this lands first please re-base #923. If #923 lands first, I will rebase my changes.
I think you need to add some documentation about per interface dns in doc/rtd/topics/network-config-format-v1.rst
|
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com> Signed-off-by: Shreenidhi Shedi <yesshedi@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sshedi , I think this looks good now.
Thanks for working with me to get everything done needed to get this across the finish line!
Pleasure was all mine. Thanks James for all your insightful comments and being patient with me all this while and making me understand things better. Enjoyed working with you. Will be sending incremental fixes and improvements from now on. Have a good time ahead, thanks again. |
Signed-off-by: Shreenidhi Shedi sshedi@vmware.com
Signed-off-by: Shreenidhi Shedi yesshedi@gmail.com
Proposed Commit Message
Additional Context
Test Steps
Checklist: