Skip to content

Commit

Permalink
Support installation of Neutron ZVM Driver
Browse files Browse the repository at this point in the history
Allow deploying with the ZVM L2 driver.
  • Loading branch information
dirkmueller committed Dec 9, 2015
1 parent bebb2af commit a994df7
Show file tree
Hide file tree
Showing 9 changed files with 169 additions and 1 deletion.
6 changes: 6 additions & 0 deletions chef/cookbooks/neutron/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
ovs_agent_name: "openstack-neutron-openvswitch-agent",
lb_agent_pkg: "openstack-neutron-linuxbridge-agent",
lb_agent_name: "openstack-neutron-linuxbridge-agent",
zvm_agent_pkg: "openstack-neutron-zvm-agent",
zvm_agent_name: "openstack-neutron-zvm-agent",
lbaas_agent_pkg: "openstack-neutron-lbaas-agent",
lbaas_agent_name: "openstack-neutron-lbaas-agent",
lbaas_haproxy_group: "haproxy",
Expand Down Expand Up @@ -92,6 +94,8 @@
ovs_agent_name: "neutron-openvswitch-agent",
lb_agent_pkg: "openstack-neutron-linuxbridge",
lb_agent_name: "neutron-linuxbridge-agent",
zvm_agent_pkg: "openstack-neutron-zvm-agent",
zvm_agent_name: "openstack-neutron-zvm-agent",
lbaas_agent_pkg: "openstack-neutron-lbaas-agent",
lbaas_agent_name: "neutron-lbaas-agent",
lbaas_haproxy_group: "nogroup",
Expand Down Expand Up @@ -119,6 +123,8 @@
ovs_agent_name: "neutron-plugin-openvswitch-agent",
lb_agent_pkg: "neutron-plugin-linuxbridge-agent",
lb_agent_name: "neutron-plugin-linuxbridge-agent",
zvm_agent_pkg: "neutron-zvm-agent",
zvm_agent_name: "neutron-zvm-agent",
lbaas_agent_pkg: "neutron-lbaas-agent",
lbaas_agent_name: "neutron-lbaas-agent",
lbaas_haproxy_group: "nogroup",
Expand Down
19 changes: 19 additions & 0 deletions chef/cookbooks/neutron/recipes/common_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
# ML2 configuration: L2 agent and L3 agent
if neutron[:neutron][:networking_plugin] == "ml2"
ml2_mech_drivers = neutron[:neutron][:ml2_mechanism_drivers]
ml2_mech_drivers = ["zvm"] if node["kernel"]["machine"] =~ /s390x/
ml2_type_drivers = neutron[:neutron][:ml2_type_drivers]

case
Expand Down Expand Up @@ -153,6 +154,13 @@
end
end
end
when ml2_mech_drivers.include?("zvm")
package node[:neutron][:platform][:zvm_agent_pkg]

neutron_agent = node[:neutron][:platform][:zvm_agent_name]
agent_config_path = "/etc/neutron/plugins/zvm/neutron_zvm_plugin.ini"
physnet = node[:crowbar_wall][:network][:nets][:nova_fixed].first
interface_mappings = "physnet1:" + physnet
end

# include neutron::common_config only now, after we've installed packages
Expand Down Expand Up @@ -207,6 +215,17 @@
interface_mappings: interface_mappings
)
end
when ml2_mech_drivers.include?("zvm")
template agent_config_path do
cookbook "neutron"
source "neutron_zvm_plugin.ini.erb"
owner "root"
group node[:neutron][:platform][:group]
mode "0640"
variables(
zvm: neutron[:neutron][:zvm]
)
end
end

service neutron_agent do
Expand Down
2 changes: 2 additions & 0 deletions chef/cookbooks/neutron/recipes/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

pkgs = node[:neutron][:platform][:pkgs] + node[:neutron][:platform][:pkgs_fwaas]
pkgs += node[:neutron][:platform][:pkgs_lbaas] if node[:neutron][:use_lbaas]
pkgs << node[:neutron][:platform][:zvm_agent_pkg] if node[:neutron][:networking_plugin] == "ml2"
pkgs.each { |p| package p }

include_recipe "neutron::database"
Expand Down Expand Up @@ -160,6 +161,7 @@
#TODO(vuntz): temporarily disable the hyperv mechanism since we're lacking networking-hyperv from stackforge
#ml2_mechanism_drivers = node[:neutron][:ml2_mechanism_drivers].dup.push("hyperv")
ml2_mechanism_drivers = node[:neutron][:ml2_mechanism_drivers].dup
ml2_mechanism_drivers = ["zvm"]
if ml2_type_drivers.include?("gre") || ml2_type_drivers.include?("vxlan")
ml2_mechanism_drivers.push("l2population")
end
Expand Down
109 changes: 109 additions & 0 deletions chef/cookbooks/neutron/templates/default/neutron_zvm_plugin.ini.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
[AGENT]
# (StrOpt) xCat REST API username, default value is admin.
# zvm_xcat_username = admin
# Example: zvm_xcat_username = guest
zvm_xcat_username = <%= @zvm[:zvm_xcat_username] %>

# (StrOpt) Password of the xCat REST API user, default value is admin
# zvm_xcat_password = admin
zvm_xcat_password = <%= @zvm[:zvm_xcat_password] %>

# (StrOpt) xCat MN server address, IP address or host name
# zvm_xcat_server = YourxCATMNServerAddress
zvm_xcat_server = <%= @zvm[:zvm_xcat_server] %>

# (StrOpt) xCat zHCP nodename in xCAT, default value is zhcp
# xcat_zhcp_nodename = zhcp
# Example: xcat_zhcp_nodename = myzhcp1

# (StrOpt) The compute node name neutron-zvm-agent work on, same as 'host'in nova.conf
# This property is optional. If it is not specified, 'host' in neutron.conf will be
# used. Moreover, 'host' in neutron.conf is recommended and this property is deprecated.
# zvm_host = opnstk1
# Example: zvm_host = opnstk1

# (IntOpt) Agent's polling interval in seconds, default value is 2 seconds
# polling_interval = 2
# Example: polling_interval = 5

# (IntOpt) The number of seconds the agent will wait for
# xCAT MN response, default value is 300 seconds
# zvm_xcat_timeout = 300
# Example: zvm_xcat_timeout = 600

# (StrOpt ) xcat management NIC IP.
# xcat_mgt_ip = 10.1.0.1
# Example: xcat_mgt_ip=10.1.0.1

# (StrOpt ) xcat management NIC mask.
# xcat_mgt_mask=255.255.0.0
# Example: xcat_mgt_mask=255.255.0.0

# (StrOpt ) rdev_list for each vswitch's uplink real device(s), seperated by ','.
# If a vswitch does not connect an OSA, which means it does not connect to
# external network, rdev_list can be ignored.
# A new section is required for each vswitch which has a uplink port.
# rdev_list = 6000
# Example:
# [xcatvsw3]
# rdev_list = 6000,6003,6005

#-----------------------------------------------------------------------------
# Sample Configurations.
#-----------------------------------------------------------------------------

# 1. Single FLAT Mode
# Physical network names should be identical to z/VM vswitch names. In
# this sample, xcatvsw2 is used for xCAT Management Network, it should be a
# Layer 2, VLAN UNAWARE vswitch in z/VM. When create neutron network, set
# xcatvsw2 provider network_type to flat

# Neutron server:
#
# [database]
# connection = mysql://root:[email protected]:3306/neutron
# [ml2_type_flat]
# flat_networks = xcatvsw2

# Neutron z/VM Agent:
#
# [AGENT]
# zvm_xcat_username = admin
# zvm_xcat_password = admin
# zvm_xcat_server = 10.0.0.1
# xcat_zhcp_nodename = zhcp
# polling_interval = 2
# zvm_xcat_timeout = 300
# xcat_mgt_ip = 10.1.0.1
# xcat_mgt_mask=255.255.0.0

# 2. FLAT, VLAN mixed Mode
# Physical network names should be identical to z/VM vswitch names. In
# this sample, xcatvsw2 is used for xCAT Management Network, it should be a
# Layer 2, VLAN UNAWARE vswitch in z/VM, xcatvsw3 is used for OpenStack
# Compute/Data Network, it is a Layer 2, VLAN AWARE vswitch in z/VM. xCAT
# Management Network MUST be the first created network. This configuration
# also can used for single FLAT network mode if you only create only one
# FLAT network with xcatvsw2

# Neutron server:
#
# [database]
# connection = mysql://root:[email protected]:3306/neutron
# [ml2_type_vlan]
# network_vlan_ranges = xcatvsw3:10:100
#
# Neutron z/VM Agent:
#
# [AGENT]
# zvm_xcat_username = admin
# zvm_xcat_password = admin
# zvm_xcat_server = 10.0.0.1
# xcat_zhcp_nodename = zhcp
# polling_interval = 2
# zvm_xcat_timeout = 300
# xcat_mgt_ip = 10.1.0.1
# xcat_mgt_mask=255.255.0.0
#
# [xcatvsw3]
# rdev_list=6243
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
def upgrade(ta, td, a, d)
a["zvm"] = ta["zvm"]
return a, d
end

def downgrade(ta, td, a, d)
a.delete("zvm")
return a, d
end
7 changes: 6 additions & 1 deletion chef/data_bags/crowbar/template-neutron.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
"tz_uuid": "",
"l3_gw_uuid": ""
},
"zvm": {
"zvm_xcat_server": "",
"zvm_xcat_username": "",
"zvm_xcat_password": ""
},
"ssl": {
"certfile": "/etc/neutron/ssl/certs/signing_cert.pem",
"keyfile": "/etc/neutron/ssl/private/signing_key.pem",
Expand All @@ -67,7 +72,7 @@
"neutron": {
"crowbar-revision": 0,
"crowbar-applied": false,
"schema-revision": 44,
"schema-revision": 45,
"element_states": {
"neutron-server": [ "readying", "ready", "applying" ],
"neutron-network": [ "readying", "ready", "applying" ]
Expand Down
5 changes: 5 additions & 0 deletions chef/data_bags/crowbar/template-neutron.schema
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@
"tz_uuid": { "type" : "str", "required" : true },
"l3_gw_uuid": { "type" : "str", "required" : true }
}},
"zvm": { "type": "map", "required": true, "mapping": {
"zvm_xcat_server": { "type": "str", "required": true },
"zvm_xcat_username": { "type": "str", "required": true },
"zvm_xcat_password": { "type": "str", "required": true }
}},
"ssl": { "type": "map", "required": true, "mapping": {
"certfile": { "type" : "str", "required" : true },
"keyfile": { "type" : "str", "required" : true },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,14 @@
%td
= link_to t(".clear_port"), "#", :class => "btn btn-default btn-block", "data-clear" => node.handle

%fieldset
%legend
= t(".zvm_header")

= string_field %w(zvm zvm_xcat_server)
= string_field %w(zvm zvm_xcat_username)
= password_field %w(zvm zvm_xcat_password)

%fieldset
%legend
= t(".ssl_header")
Expand Down
5 changes: 5 additions & 0 deletions crowbar_framework/config/locales/neutron/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ en:
controllers: 'VMware NSX Controllers'
tz_uuid: 'UUID of the NSX Transport Zone'
l3_gw_uuid: 'UUID of the NSX Gateway Service'
zvm_header: 'z/VM Configuration'
zvm:
zvm_xcat_server: 'xCAT Host/IP Address'
zvm_xcat_username: 'xCAT Username'
zvm_xcat_password: 'xCAT Password'
ssl_header: 'SSL Support'
api:
protocol: 'Protocol'
Expand Down

0 comments on commit a994df7

Please sign in to comment.