exec_cmd('fuel node set --node-id %s --role %s --env %s'
% (node_id, roles_blade[0], self.env_id))
- # Download the unmodified default deployment configuration, because we
- # need it for the network config.
- self.download_deployment_config()
for node_id, roles_blade in self.node_id_roles_dict.iteritems():
# Modify node attributes
self.download_attributes(node_id)
# Modify interfaces configuration
self.download_interface_config(node_id)
self.modify_node_interface(node_id, roles_blade)
- self.modify_node_network_schemes(node_id, roles_blade)
self.upload_interface_config(node_id)
+ # Currently not used, we use default deployment facts
+ # which are generated by fuel based on type segmentation
+ # and network to nic assignment
+ #
# Download our modified deployment configuration, which includes our
# changes to network topology etc.
- self.download_deployment_config()
- self.upload_deployment_config()
+ #self.download_deployment_config()
+ #for node_id, roles_blade in self.node_id_roles_dict.iteritems():
+ # self.modify_node_network_schemes(node_id, roles_blade)
+ #self.upload_deployment_config()
def modify_node_network_schemes(self, node_id, roles_blade):
log('Modify network transformations for node %s' % node_id)
deployment_dir = '%s/deployment_%s' % (
self.yaml_config_dir, self.env_id)
backup(deployment_dir)
- for node_file in glob.glob(deployment_dir + '/*_%s.yaml' % node_id):
- with io.open(node_file) as stream:
- node = yaml.load(stream)
+ node_file = ('%s/%s.yaml' % (deployment_dir, node_id))
+ with io.open(node_file) as stream:
+ node = yaml.load(stream)
- node['network_scheme'].update(transformations)
+ node['network_scheme'].update(transformations)
- with io.open(node_file, 'w') as stream:
- yaml.dump(node, stream, default_flow_style=False)
+ with io.open(node_file, 'w') as stream:
+ yaml.dump(node, stream, default_flow_style=False)
def download_deployment_config(self):
log('Download deployment config for environment %s' % self.env_id)
with open(attributes_yaml, 'w') as stream:
yaml.dump(result_attributes, stream, default_flow_style=False)
+ # interface configuration can
+ # looks like this:
+ #
+ # interfaces_dpdk:
+ # ens3:
+ # - fuelweb_admin
+ # ens4:
+ # - storage
+ # - management
+ # ens5:
+ # - interface_properties:
+ # dpdk:
+ # enabled: true
+ # - private
+ # ens6:
+ # - public
def modify_node_interface(self, node_id, roles_blade):
log('Modify interface config for node %s' % node_id)
interface_yaml = ('%s/node_%s/interfaces.yaml'
for interface in interfaces:
interface['assigned_networks'] = []
if interface['name'] in interface_config:
- for net_name in interface_config[interface['name']]:
+ for prop in interface_config[interface['name']]:
net = {}
- net['id'] = net_name_id[net_name]
- net['name'] = net_name
- interface['assigned_networks'].append(net)
+ #net name
+ if isinstance(prop, six.string_types):
+ net['id'] = net_name_id[prop]
+ net['name'] = prop
+ interface['assigned_networks'].append(net)
+ #network properties
+ elif isinstance(prop, dict):
+ if not 'interface_properties' in prop:
+ log('Interface configuration contain unknow dict: %s' % prop)
+ continue
+ interface['interface_properties'] = \
+ self._merge_dicts(interface.get('interface_properties', {}),
+ prop.get('interface_properties', {}))
with io.open(interface_yaml, 'w') as stream:
yaml.dump(interfaces, stream, default_flow_style=False)
- private
ens6:
- public
-transformations_1:
- transformations:
- - action: add-br
- name: br-fw-admin
- - action: add-br
- name: br-mgmt
- - action: add-br
- name: br-storage
- - action: add-br
- name: br-ex
- - action: add-br
- name: br-floating
- provider: ovs
- - action: add-patch
- bridges:
- - br-floating
- - br-ex
- mtu: 65000
- provider: ovs
- - action: add-br
- name: br-mesh
- - action: add-port
- bridge: br-fw-admin
- name: ens3
- - action: add-port
- bridge: br-mgmt
- name: ens4
- - action: add-port
- bridge: br-storage
- name: ens3.102
- - action: add-port
- bridge: br-mesh
- name: ens5.103
- - action: add-port
- bridge: br-ex
- name: ens6
+interfaces_dpdk:
+ ens3:
+ - fuelweb_admin
+ - storage
+ ens4:
+ - management
+ ens5:
+ - private
+ - interface_properties:
+ dpdk:
+ enabled: true
+ ens6:
+ - public
+interfaces_vlan:
+ ens3:
+ - fuelweb_admin
+ - storage
+ ens4:
+ - management
+ ens5:
+ - private
+ ens6:
+ - public
fuel:
ADMIN_NETWORK:
dhcp_pool_end: 10.20.0.254
- private
ens6:
- public
-transformations_1:
- transformations:
- - action: add-br
- name: br-fw-admin
- - action: add-br
- name: br-mgmt
- - action: add-br
- name: br-storage
- - action: add-br
- name: br-ex
- - action: add-br
- name: br-floating
- provider: ovs
- - action: add-patch
- bridges:
- - br-floating
- - br-ex
- mtu: 65000
- provider: ovs
- - action: add-br
- name: br-mesh
- - action: add-port
- bridge: br-fw-admin
- name: ens3
- - action: add-port
- bridge: br-mgmt
- name: ens4
- - action: add-port
- bridge: br-storage
- name: ens3.102
- - action: add-port
- bridge: br-mesh
- name: ens5.103
- - action: add-port
- bridge: br-ex
- name: ens6
+interfaces_dpdk:
+ ens3:
+ - fuelweb_admin
+ - storage
+ ens4:
+ - management
+ ens5:
+ - private
+ - interface_properties:
+ dpdk:
+ enabled: true
+ ens6:
+ - public
+interfaces_vlan:
+ ens3:
+ - fuelweb_admin
+ - storage
+ ens4:
+ - management
+ ens5:
+ - private
+ ens6:
+ - public
fuel:
ADMIN_NETWORK:
dhcp_pool_end: 10.20.0.254
- private
ens6:
- public
-transformations_1:
- transformations:
- - action: add-br
- name: br-fw-admin
- - action: add-br
- name: br-mgmt
- - action: add-br
- name: br-storage
- - action: add-br
- name: br-ex
- - action: add-br
- name: br-floating
- provider: ovs
- - action: add-patch
- bridges:
- - br-floating
- - br-ex
- mtu: 65000
- provider: ovs
- - action: add-br
- name: br-mesh
- - action: add-port
- bridge: br-fw-admin
- name: ens3
- - action: add-port
- bridge: br-mgmt
- name: ens4
- - action: add-port
- bridge: br-storage
- name: ens3.102
- - action: add-port
- bridge: br-mesh
- name: ens5.103
- - action: add-port
- bridge: br-ex
- name: ens6
+interfaces_dpdk:
+ ens3:
+ - fuelweb_admin
+ - storage
+ ens4:
+ - management
+ ens5:
+ - private
+ - interface_properties:
+ dpdk:
+ enabled: true
+ ens6:
+ - public
+interfaces_vlan:
+ ens3:
+ - fuelweb_admin
+ - storage
+ ens4:
+ - management
+ ens5:
+ - private
+ ens6:
+ - public
fuel:
ADMIN_NETWORK:
dhcp_pool_end: 10.20.0.254
- private
ens6:
- public
-transformations_1:
- transformations:
- - action: add-br
- name: br-fw-admin
- - action: add-br
- name: br-mgmt
- - action: add-br
- name: br-storage
- - action: add-br
- name: br-ex
- - action: add-br
- name: br-floating
- provider: ovs
- - action: add-patch
- bridges:
- - br-floating
- - br-ex
- mtu: 65000
- provider: ovs
- - action: add-br
- name: br-mesh
- - action: add-port
- bridge: br-fw-admin
- name: ens3
- - action: add-port
- bridge: br-mgmt
- name: ens4
- - action: add-port
- bridge: br-storage
- name: ens3.102
- - action: add-port
- bridge: br-mesh
- name: ens5.103
- - action: add-port
- bridge: br-ex
- name: ens6
+interfaces_dpdk:
+ ens3:
+ - fuelweb_admin
+ - storage
+ ens4:
+ - management
+ ens5:
+ - private
+ - interface_properties:
+ dpdk:
+ enabled: true
+ ens6:
+ - public
+interfaces_vlan:
+ ens3:
+ - fuelweb_admin
+ - storage
+ ens4:
+ - management
+ ens5:
+ - private
+ ens6:
+ - public
fuel:
ADMIN_NETWORK:
dhcp_pool_end: 10.20.0.254
- id: 1
interfaces: interfaces_1
role: mongo,controller,opendaylight
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 5
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
settings:
editable:
- id: 1
interfaces: interfaces_1
role: controller
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: mongo, controller
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,controller
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 5
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
dha-override-config:
nodes:
- id: 1
interfaces: interfaces_1
role: controller,mongo
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: controller
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: controller
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: compute,ceph-osd
- transformations: transformations_1
- id: 5
interfaces: interfaces_1
role: compute,ceph-osd
- transformations: transformations_1
settings:
editable:
net_segment_type: vlan
nodes:
- id: 1
- interfaces: interfaces_dpdk
+ interfaces: interfaces_vlan
role: controller
- transformations: transformations_vlan
- id: 2
- interfaces: interfaces_dpdk
+ interfaces: interfaces_vlan
role: mongo,controller
- transformations: transformations_vlan
- id: 3
- interfaces: interfaces_dpdk
+ interfaces: interfaces_vlan
role: ceph-osd,controller
- transformations: transformations_vlan
- id: 4
interfaces: interfaces_dpdk
role: ceph-osd,compute
- transformations: transformations_dpdk
attributes: attributes_1
- id: 5
interfaces: interfaces_dpdk
role: ceph-osd,compute
- transformations: transformations_dpdk
attributes: attributes_1
attributes_1:
- id: 1
interfaces: interfaces_1
role: controller,opendaylight
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,controller
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 5
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
dha-override-config:
- id: 1
interfaces: interfaces_1
role: controller,opendaylight
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,controller
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 5
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
dha-override-config:
nodes:
- id: 1
interfaces: interfaces_1
role: controller,opendaylight
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,controller
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 5
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
dha-override-config:
nodes:
- id: 1
- id: 1
interfaces: interfaces_1
role: controller,opendaylight
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,controller
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 5
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
settings:
editable:
public_network_assignment:
- id: 1
interfaces: interfaces_1
role: controller,onos
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,controller
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 5
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
settings:
editable:
public_network_assignment:
- id: 1
interfaces: interfaces_1
role: controller,onos
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,controller
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 5
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
settings:
editable:
public_network_assignment:
- id: 1
interfaces: interfaces_1
role: controller
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,controller
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 5
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
settings:
editable:
- id: 1
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
dha-override-config:
# disks:
- id: 1
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: ceph-osd
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: compute
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: compute
- transformations: transformations_1
settings:
editable:
- id: 1
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_2
- id: 3
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_2
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_2
settings:
editable:
additional_components:
net_segment_type: vlan
nodes:
- id: 1
- interfaces: interfaces_dpdk
+ interfaces: interfaces_vlan
role: mongo,controller
- transformations: transformations_vlan
- id: 2
interfaces: interfaces_dpdk
role: ceph-osd,compute
- transformations: transformations_dpdk
attributes: attributes_1
- id: 3
interfaces: interfaces_dpdk
role: ceph-osd,compute
- transformations: transformations_dpdk
attributes: attributes_1
- id: 4
interfaces: interfaces_dpdk
role: ceph-osd,compute
- transformations: transformations_dpdk
attributes: attributes_1
attributes_1:
- id: 1
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: ceph-osd,opendaylight
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
dha-override-config:
# disks:
- id: 1
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: ceph-osd,opendaylight
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
dha-override-config:
# disks:
- id: 1
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: ceph-osd,opendaylight
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
dha-override-config:
# disks:
- id: 1
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: ceph-osd,opendaylight
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
settings:
editable:
public_network_assignment:
- id: 1
interfaces: interfaces_1
role: mongo,controller,onos
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
settings:
editable:
public_network_assignment:
- id: 1
interfaces: interfaces_1
role: mongo,controller,onos
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
settings:
editable:
public_network_assignment:
- id: 1
interfaces: interfaces_1
role: mongo,controller
- transformations: transformations_1
- id: 2
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 3
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
- id: 4
interfaces: interfaces_1
role: ceph-osd,compute
- transformations: transformations_1
settings:
editable:
additional_components: