sysconfig render does not support type manual subnets

Bug #1687725 reported by Ryan Harper
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Ryan Harper

Bug Description

Attempting to a render a network configuration like this:

% cat manual_subnet.yaml
    version: 1
        # Physical interfaces.
        - type: physical
          name: interface0
          mac_address: "52:54:00:12:34:00"
              - type: manual

Attempting to render this into sysconfig results in a traceback.
% PYTHONPATH=`pwd` ./tools/ --network-data manual_subnet.yaml --kind yaml --output-kind sysconfig -d target

Traceback (most recent call last):
  File "./tools/", line 82, in <module>
  File "./tools/", line 78, in main
  File "/home/rharper/work/git/cloud-init/cloudinit/net/", line 410, in render_network_state
  File "/home/rharper/work/git/cloud-init/cloudinit/net/", line 391, in _render_sysconfig
    cls._render_physical_interfaces(network_state, iface_contents)
  File "/home/rharper/work/git/cloud-init/cloudinit/net/", line 311, in _render_physical_interfaces
    cls._render_subnet(iface_cfg, route_cfg, iface_subnets[0])
  File "/home/rharper/work/git/cloud-init/cloudinit/net/", line 238, in _render_subnet
ValueError: Unknown subnet type 'manual' found for interface 'interface0'

Sysconfig does have an equivalent of eni's 'manual' control mode, the ONBOOT=N setting tells sysconfig to ignore this interface when booting. Later users can ifup the interface.

1. no cloud, just in-tree rendering
2. cloud-init master branch

Tags: centos7

Related branches

Revision history for this message
Ryan Harper (raharper) wrote :

commit 79795bd3098c3bef1fb39cc62bc8d1b3a2a81e5f
Author: Ryan Harper <email address hidden>
Date: Thu Jun 15 13:12:03 2017 -0500

    sysconfig: handle manual type subnets

diff --git a/cloudinit/net/ b/cloudinit/net/
index 4edde3c..b81e57a 100644
--- a/cloudinit/net/
+++ b/cloudinit/net/
@@ -291,6 +291,8 @@ class Renderer(renderer.Renderer):
                 # iface_cfg['BOOTPROTO'] = 'static'
                 if subnet_is_ipv6(subnet):
                     iface_cfg['IPV6INIT'] = True
+ elif subnet_type == 'manual':
+ iface_cfg['ONBOOT'] = False
                 raise ValueError("Unknown subnet type '%s' found"
                                  " for interface '%s'" % (subnet_type,

Scott Moser (smoser)
Changed in cloud-init:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Ryan Harper (raharper)
Scott Moser (smoser)
Changed in cloud-init:
status: Confirmed → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote : Fixed in Cloud-init 17.1

This bug is believed to be fixed in cloud-init in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.