Comment 6 for bug 1640635

Revision history for this message
Scott Moser (smoser) wrote :

The way this is working in cloud-init seems to me to make some sense.
Basically, there are 3 places cloud-init can get its network configuration. In order of increasing precedence:
 1. datasource (only works for local datasources currently)
 2. system configuration
 3. kernel command line.
    a.) ip= argument: files written by the initramfs networking system (/run/net-eth0.conf) for example.

    b.) network-config= argument. This is yaml formated text blob.

So, if datasource (1) provides network config, but the system says not to pay attention to it (2), then cloud-init will not write network config. Similarly if system says it is disabled, but the kernel command line enables it, then cloud-init will write networking config.

You're kind of hitting a weird situation where the kernel cmdline has 3a, but you dont want cloud-init to render system based on that. (The reason you dont is a bug somewhere, but I'm not sure, as this does not happen in many iscsi root scenarios that we have and test).

One solution I think should work for you is if you pass on the kernel command line:
 network-config=eyJuZXR3b3JrIjp7ImNvbmZpZyI6ImRpc2FibGVkIn19fQ==

This is specifying the config to cloud-init in base64 encoded network config format (described at http://curtin.readthedocs.io/en/latest/topics/networking.html).

So what you have there is:
$ echo eyJuZXR3b3JrIjp7ImNvbmZpZyI6ImRpc2FibGVkIn19fQ== | base64 --decode ; echo
{"network":{"config":"disabled"}}}

Last thing... I see 'netroot=' on you command line.
I'm guessing that means you've generated an initramfs with dracut?
I do not know how well that would be supported in ubuntu. My experience with iscsi root is with initramfs-tools which would take a different form of kernel command line.

In 16.04 and later you should be able to use root=iscsi:<rfc4173>
 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=804162
I think that is also supported in dracut if you're looking for something supported by both.