From 4113bc2656c86f6057dcf3bc5f18ac1e3619fd45 Mon Sep 17 00:00:00 2001 From: "chenshuai@huawei.com" Date: Sat, 16 Jan 2016 16:51:54 +0800 Subject: bugfix: opencontrail neutron and nova plugins code JIRA: COMPASS-274 Change-Id: I6ee4b9fac51a0fc5f4ac9916ea16ab9d363ec943 Signed-off-by: chenshuai@huawei.com --- .../open-contrail/tasks/install/install-config.yml | 19 +++++++++++++++ .../ansible/roles/open-contrail/tasks/main.yml | 9 +++++++ .../tasks/provision/.provision-compute.yml.swp | Bin 0 -> 16384 bytes .../tasks/provision/provision-compute.yml | 26 +++++++++++++++++++++ .../tasks/provision/provision-config.yml | 23 ++++++++++++++++++ .../templates/neutron_plugin_contrail.tar.gz | Bin 0 -> 73771 bytes .../templates/nova_contrail_vif.tar.gz | Bin 0 -> 3552 bytes .../provision/contrail-vrouter-agent-conf.j2 | 4 ++-- 8 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 deploy/adapters/ansible/roles/open-contrail/tasks/provision/.provision-compute.yml.swp create mode 100644 deploy/adapters/ansible/roles/open-contrail/templates/neutron_plugin_contrail.tar.gz create mode 100644 deploy/adapters/ansible/roles/open-contrail/templates/nova_contrail_vif.tar.gz diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml index dbd542be..17163fca 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/install/install-config.yml @@ -16,6 +16,25 @@ src: "../../templates/install/override.j2" dest: "/etc/init/neutron-server.override" +############################################### +################ workaround ################# +############################################### +#- name: "backup keepalived conf" +# shell: mv /etc/keepalived/keepalived.conf /home/keepalived.conf + +#- name: "uninstall keepalived" +# action: "{{ ansible_pkg_mgr }} name=keepalived state=absent" + +#- name: "install iproute" +# action: "{{ ansible_pkg_mgr }} name=iproute state=present" + +#- name: "install iproute" +# action: "{{ ansible_pkg_mgr }} name=keepalived state=present" + +#- name: "restore keepalived conf" +# shell: mv /home/keepalived.conf /etc/keepalived/keepalived.conf +############################################### + - name: "install contrail openstack config package" # sudo: True # apt: diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml index d2c69600..2544b0ff 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/main.yml @@ -2,6 +2,11 @@ - include_vars: "{{ ansible_os_family }}.yml" +- name: Disable Service Daemon + template: + src: "/opt/service" + dest: "/opt/service.backup" + - name: Install common on all hosts for Open Contrail include: install/install-common.yml when: groups['opencontrail_control']|length !=0 @@ -97,6 +102,10 @@ include: provision/provision-compute.yml when: inventory_hostname in groups['opencontrail_compute'] +- name: Enable Service Daemon + template: + src: "/opt/service.backup" + dest: "/opt/service" #- name: Provision tsn for Open Contrail # include: provision/provision-tsn.yml diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/.provision-compute.yml.swp b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/.provision-compute.yml.swp new file mode 100644 index 00000000..41980448 Binary files /dev/null and b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/.provision-compute.yml.swp differ diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml index 4fbff0b7..c8db15b6 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-compute.yml @@ -165,6 +165,32 @@ with_items: - { section: "DEFAULT", option: "network_api_class", value: "nova_contrail_vif.contrailvif.ContrailNetworkAPI" } + + +################################################# +########### nova plugin workaround ############ +################################################# + +- name: "copy nova plugs on compute" + template: + src: "nova_contrail_vif.tar.gz" + dest: "/opt/nova_contrail_vif.tar.gz" + +- name: "unzip nova plugs" + command: su -s /bin/sh -c "tar xzf /opt/nova_contrail_vif.tar.gz -C /opt/" + +- name: "remove original nova plugs" + shell: rm -rf /usr/lib/python2.7/dist-packages/nova_contrail_vif/ + +- name: "use new neutron plugs" + shell: mv /opt/nova_contrail_vif/ /usr/lib/python2.7/dist-packages/nova_contrail_vif/ + +################################################# + + + + + - name: "restart nova compute" service: name: "nova-compute" diff --git a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml index 943214fd..99a18dba 100755 --- a/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml +++ b/deploy/adapters/ansible/roles/open-contrail/tasks/provision/provision-config.yml @@ -229,6 +229,29 @@ state: "restarted" + +########################################################### +############# neutron plugins workaround ################## +########################################################### + +- name: "copy neutron plugs on controller" + template: + src: "neutron_plugin_contrail.tar.gz" + dest: "/opt/neutron_plugin_contrail.tar.gz" + +- name: "unzip neutron plugs" + command: su -s /bin/sh -c "tar xzf /opt/neutron_plugin_contrail.tar.gz -C /opt/" + +- name: "remove original neutron plugs" + shell: rm -rf /usr/lib/python2.7/dist-packages/neutron_plugin_contrail/ + +- name: "use new neutron plugs" + shell: mv /opt/neutron_plugin_contrail/ /usr/lib/python2.7/dist-packages/neutron_plugin_contrail/ + +########################################################### + + + - name: "restart neutron-server" service: name: "neutron-server" diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/neutron_plugin_contrail.tar.gz b/deploy/adapters/ansible/roles/open-contrail/templates/neutron_plugin_contrail.tar.gz new file mode 100644 index 00000000..08077049 Binary files /dev/null and b/deploy/adapters/ansible/roles/open-contrail/templates/neutron_plugin_contrail.tar.gz differ diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/nova_contrail_vif.tar.gz b/deploy/adapters/ansible/roles/open-contrail/templates/nova_contrail_vif.tar.gz new file mode 100644 index 00000000..78dac037 Binary files /dev/null and b/deploy/adapters/ansible/roles/open-contrail/templates/nova_contrail_vif.tar.gz differ diff --git a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-vrouter-agent-conf.j2 b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-vrouter-agent-conf.j2 index 78b31775..d0d6b966 100755 --- a/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-vrouter-agent-conf.j2 +++ b/deploy/adapters/ansible/roles/open-contrail/templates/provision/contrail-vrouter-agent-conf.j2 @@ -66,7 +66,7 @@ platform = default physical_interface_address = # MAC address of device used by dpdk -physical_interface_mac = {{ hostvars[inventory_hostname][contrail_device]['macaddress'] }} +physical_interface_mac = {{ hostvars[inventory_hostname][contrail_vhost_device]['macaddress'] }} [DISCOVERY] # If COLLECTOR and/or CONTROL-NODE and/or DNS is not specified this section is @@ -133,7 +133,7 @@ ip = {{ contraili_vhost_address }}/{{ contrail_prefixlen }} gateway = {{ contrail_vhost_gateway }} # Physical interface name to which virtual host interface maps to -physical_interface = {{ contrail_device }} +physical_interface = {{ contrail_vhost_device }} # We can have multiple gateway sections with different indices in the # following format -- cgit 1.2.3-korg