New Question
0

NetworkConfig problem

asked 2021-01-02 17:01:27 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hello everyone, I use it cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin Configure windows network. When an IP is not used, cloudinitbase can be configured correctly. However, when I set an IP that has been used by this virtual machine, it will not configure this IP. How can I solve this problem.

e.g: When the virtual machine uses 192.168.31.2 IP for the first time, cloudinitbase can be configured correctly. If I use cloudinitbase to modify the virtual machine IP to 192.168.31.3, the virtual machine IP will be changed to 192.168.31.3. Now when I use cloudinitbase to reset the IP to 192.168.31.2, cloudinitbase will not set the virtual machine IP to 192.168.31.2, but 192.168.31.3

Hello everyone, I use it ''cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin'' Configure windows network. When an IP is not used, cloudinitbase can be configured correctly. However, when I set an IP that has been used by this virtual machine, it will not configure this IP. How can I solve this problem.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2021-01-05 19:40:18 +0300

avladu gravatar image

Hello,

Plugins like cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin run once per instance, meaning that the network is only set once at the first boot. Any subsequent cloudbase-init runs on the same instance will not re-set the instance network.

When it runs, the cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin gets the network configuration from the metadata service, depending on the enabled metadata services in cloudbase-init config file. If the metadata is not available, the plugin cannot set any network configuration.

If possible, can you describe your setup in terms of what cloud type you are using (OpenStack, AWS or Azure) and share the cloudbase-init logs?

Thank you,
Adrian Vladu

edit flag offensive delete link more

Comments

Hello,I use openstack and the log has been uploaded to Google https://drive.google.com/file/d/1UmviYUS5M4OO_boznr4Ad8IYxfOF7wjf/view?usp=sharing

echoes123 gravatar imageechoes123 ( 2021-01-05 19:49:11 +0300 )edit

As this is a wiki post, please share the logs publicly. I suggest pastebin or http://paste.openstack.org/. Thank you.

avladu gravatar imageavladu ( 2021-01-05 20:12:37 +0300 )edit

From the logs that you have sent, it seems cloudbase-init is working as expected: it sets the network configuration the first time is configured to do so (if the networking plugin gets executed, its state is saved in the registry and it won't be executed at the next cloudbase-init run).

avladu gravatar imageavladu ( 2021-01-08 13:29:30 +0300 )edit

If I want to run the network plug-in every time cloudinitbase runs, how should I set it?

echoes123 gravatar imageechoes123 ( 2021-01-09 23:57:54 +0300 )edit

This behaviour is not currently supported on cloudbase-init, as the plugins themselves implement the run state behaviour. For your specific needs, you can create a new networkin plugin (let s say CustomNetworkingPlugin) by extending the existent one and changing the state save part.

avladu gravatar imageavladu ( 2021-01-13 12:56:59 +0300 )edit

Practically, you need to change this line https://github.com/cloudbase/cloudbase-init/blob/97295ba569c0e24fd08a37068d06df97c45dbb1f/cloudbaseinit/plugins/common/networkconfig.py#L175 to `return plugin_base.PLUGIN_EXECUTION_DONE, False` .

avladu gravatar imageavladu ( 2021-01-13 12:57:42 +0300 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-01-02 17:01:27 +0300

Seen: 592 times

Last updated: Jan 05 '21