aboutsummaryrefslogtreecommitdiffstats
path: root/deploy
diff options
context:
space:
mode:
Diffstat (limited to 'deploy')
-rw-r--r--deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors_aarch64.repo22
-rw-r--r--deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml5
-rw-r--r--deploy/adapters/ansible/kubernetes/roles/pre-k8s/files/centos_base_aarch64.repo22
-rw-r--r--deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/RedHat.yml5
-rw-r--r--deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml5
-rwxr-xr-xdeploy/adapters/ansible/roles/post-osa/files/sfc.conf9
-rw-r--r--deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml73
-rw-r--r--deploy/adapters/ansible/roles/post-osa/tasks/main.yml7
-rw-r--r--deploy/adapters/ansible/roles/post-osa/vars/main.yml5
-rw-r--r--deploy/adapters/cobbler/kickstarts/default-aarch64.ks136
-rw-r--r--deploy/adapters/cobbler/snippets/kickstart_done2
-rw-r--r--deploy/compass_conf/adapter/ansible_kubernetes.conf2
-rwxr-xr-xdeploy/compass_conf/os/centos7.3.aarch64.conf3
-rwxr-xr-xdeploy/compass_conf/os/ubuntu16.04.aarch64.conf3
-rwxr-xr-xdeploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1611-arm-arm/profile.tmpl3
-rwxr-xr-xdeploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1611-arm-arm/system.tmpl76
-rwxr-xr-xdeploy/compass_conf/templates/cobbler/ubuntu-16.04-server-arm-arm64-arm/profile.tmpl3
-rwxr-xr-xdeploy/compass_conf/templates/cobbler/ubuntu-16.04-server-arm-arm64-arm/system.tmpl75
-rw-r--r--deploy/conf/compass.conf17
-rwxr-xr-xdeploy/host_virtual.sh31
-rwxr-xr-xdeploy/prepare.sh82
-rw-r--r--deploy/template/vm/host-aarch64.xml58
22 files changed, 604 insertions, 40 deletions
diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors_aarch64.repo b/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors_aarch64.repo
new file mode 100644
index 0000000..1d622d3
--- /dev/null
+++ b/deploy/adapters/ansible/kubernetes/roles/kargo/files/mirrors_aarch64.repo
@@ -0,0 +1,22 @@
+[base]
+name=CentOS-$releasever - Base
+baseurl=http://mirror.centos.org/altarch/$releasever/os/$basearch/
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
+ file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64
+
+#released updates
+[updates]
+name=CentOS-$releasever - Updates
+baseurl=http://mirror.centos.org/altarch/$releasever/updates/$basearch/
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
+ file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64
+
+#additional packages that may be useful
+[extras]
+name=CentOS-$releasever - Extras
+baseurl=http://mirror.centos.org/altarch/$releasever/extras/$basearch/
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
+ file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64
diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml
index 6d6720b..4df8dff 100644
--- a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml
+++ b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml
@@ -23,8 +23,11 @@
- name: configure local mirror repo
copy:
- src: mirrors.repo
+ src: "{{ item }}"
dest: /etc/yum.repos.d/mirrors.repo
+ with_first_found:
+ - mirrors_{{ ansible_architecture }}.repo
+ - mirrors.repo
run_once: "True"
when: ansible_os_family == 'RedHat'
diff --git a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/files/centos_base_aarch64.repo b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/files/centos_base_aarch64.repo
new file mode 100644
index 0000000..1d622d3
--- /dev/null
+++ b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/files/centos_base_aarch64.repo
@@ -0,0 +1,22 @@
+[base]
+name=CentOS-$releasever - Base
+baseurl=http://mirror.centos.org/altarch/$releasever/os/$basearch/
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
+ file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64
+
+#released updates
+[updates]
+name=CentOS-$releasever - Updates
+baseurl=http://mirror.centos.org/altarch/$releasever/updates/$basearch/
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
+ file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64
+
+#additional packages that may be useful
+[extras]
+name=CentOS-$releasever - Extras
+baseurl=http://mirror.centos.org/altarch/$releasever/extras/$basearch/
+gpgcheck=1
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
+ file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64
diff --git a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/RedHat.yml b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/RedHat.yml
index 58af0f7..8e410e1 100644
--- a/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/RedHat.yml
+++ b/deploy/adapters/ansible/kubernetes/roles/pre-k8s/tasks/RedHat.yml
@@ -51,5 +51,8 @@
- name: change sources(yum) list
copy:
- src: centos_base.repo
+ src: "{{ item }}"
dest: /etc/yum.repos.d/centos_base.repo
+ with_first_found:
+ - centos_base_{{ ansible_architecture }}.repo
+ - centos_base.repo
diff --git a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
index ef7128c..8d94438 100644
--- a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
+++ b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml
@@ -41,7 +41,10 @@
- setup-openstack
- sync-inventory
-- hosts: compute
+- hosts:
+ - compute
+ - utility
+ - neutron_server
remote_user: root
roles:
- post-osa
diff --git a/deploy/adapters/ansible/roles/post-osa/files/sfc.conf b/deploy/adapters/ansible/roles/post-osa/files/sfc.conf
new file mode 100755
index 0000000..ce42c9e
--- /dev/null
+++ b/deploy/adapters/ansible/roles/post-osa/files/sfc.conf
@@ -0,0 +1,9 @@
+[DEFAULT]
+
+service_plugins = router,metering,flow_classifier,sfc
+
+[sfc]
+drivers = ovs
+
+[flowclassifier]
+drivers = ovs
diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml b/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml
new file mode 100644
index 0000000..fbed581
--- /dev/null
+++ b/deploy/adapters/ansible/roles/post-osa/tasks/install_networking_sfc.yml
@@ -0,0 +1,73 @@
+---
+
+- name: install networking-sfc
+ pip:
+ name: networking-sfc
+ virtualenv: /openstack/venvs/neutron-15.1.4
+ when:
+ - inventory_hostname in groups['neutron_server']
+
+- name: install crudini
+ package:
+ name: crudini
+ state: latest
+ when:
+ - inventory_hostname in groups['neutron_server']
+
+- name: Install networking-sfc for CLI
+ pip:
+ name: networking-sfc
+ when:
+ - inventory_hostname in groups['utility']
+
+- name: turn off neutron-server on control node
+ service: name=neutron-server state=stopped
+ when: inventory_hostname in groups['neutron_server']
+
+- name: copy sfc.conf
+ copy:
+ src: "{{ sfc_plugins.src }}"
+ dest: "{{ sfc_plugins.dst }}"
+ mode: 0755
+ when: inventory_hostname in groups['neutron_server']
+
+- name: Configure SFC driver
+ shell: crudini --merge /etc/neutron/neutron.conf < /opt/sfc.conf
+ when: inventory_hostname in groups['neutron_server']
+
+- name: delete sfc.conf
+ shell: rm -rf {{ sfc_plugins.dst }}
+ when: inventory_hostname in groups['neutron_server']
+
+- name: Perform a Neutron DB online upgrade
+ command: |
+ /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage
+ --config-file /etc/neutron/neutron.conf
+ --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
+ upgrade --expand
+ become: "yes"
+ become_user: "neutron"
+ when: inventory_hostname in groups['neutron_server'][0]
+
+- name: Perform a Neutron DB offline upgrade
+ command: |
+ /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage
+ --config-file /etc/neutron/neutron.conf
+ --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
+ upgrade --contract
+ become: "yes"
+ become_user: "neutron"
+ when: inventory_hostname in groups['neutron_server'][0]
+
+- name: SFC DB upgrade
+ command: |
+ /openstack/venvs/neutron-15.1.4/bin/neutron-db-manage
+ --subproject networking-sfc
+ upgrade head
+ become: "yes"
+ become_user: "neutron"
+ when: inventory_hostname in groups['neutron_server'][0]
+
+- name: turn on neutron-server on control node
+ service: name=neutron-server state=started
+ when: inventory_hostname in groups['neutron_server']
diff --git a/deploy/adapters/ansible/roles/post-osa/tasks/main.yml b/deploy/adapters/ansible/roles/post-osa/tasks/main.yml
index c48a5d1..f7f7a6c 100644
--- a/deploy/adapters/ansible/roles/post-osa/tasks/main.yml
+++ b/deploy/adapters/ansible/roles/post-osa/tasks/main.yml
@@ -8,3 +8,10 @@
##############################################################################
---
- include: "{{ ansible_distribution }}.yml"
+ when: inventory_hostname in groups['compute']
+
+# install networking-sfc for non odl scenarios
+- include: install_networking_sfc.yml
+ when:
+ - odl_sfc is not defined or odl_sfc == "Disable"
+ - inventory_hostname not in groups['compute']
diff --git a/deploy/adapters/ansible/roles/post-osa/vars/main.yml b/deploy/adapters/ansible/roles/post-osa/vars/main.yml
new file mode 100644
index 0000000..4feb975
--- /dev/null
+++ b/deploy/adapters/ansible/roles/post-osa/vars/main.yml
@@ -0,0 +1,5 @@
+---
+
+sfc_plugins:
+ src: sfc.conf
+ dst: /opt/sfc.conf
diff --git a/deploy/adapters/cobbler/kickstarts/default-aarch64.ks b/deploy/adapters/cobbler/kickstarts/default-aarch64.ks
new file mode 100644
index 0000000..365694f
--- /dev/null
+++ b/deploy/adapters/cobbler/kickstarts/default-aarch64.ks
@@ -0,0 +1,136 @@
+# Kickstart for Profile: CentOS7.3_aarch64
+# Distro: CentOS7.3
+
+# System Authorization
+auth --useshadow --enablemd5
+
+#if $os_version == "rhel7"
+eula --agreed
+services --enabled=NetworkManager,sshd
+#end if
+
+# Use Graphic Mode
+text
+
+# Disable Firewall
+firewall --disabled
+
+# Run the Setup Agent on first-boot
+firstboot --disable
+
+# System Keyboard
+keyboard us
+
+# Language Setting
+lang en_US
+
+# Installation Loggin Level
+logging --level=info
+
+# Network Installation
+url --url=$tree
+
+
+$SNIPPET('kickstart_network_config')
+$SNIPPET('kickstart_yum_repo_config')
+
+# Set User Password
+#if $getVar('username', 'root') != "root"
+rootpw root
+ #set username = $getVar('username', 'root')
+ #set crypted_param = ''
+ #set password_param = '--password=%s' % $username
+ #if $getVar('password', '') != ""
+ #set crypted_param = '--iscrypted'
+ #set password_param = '--password=%s' % $password
+ #end if
+user --name=$username $crypted_param $password_param
+#else
+ #if $getVar('password', '') != ""
+rootpw --iscrypted $password
+ #else
+rootpw root
+ #end if
+#end if
+
+# Selinux Disable
+selinux --disabled
+
+# No X Window System
+skipx
+
+# System Timezone
+#if $getVar('timezone', '') != ""
+timezone --utc $timezone
+#else
+timezone --utc US/Pacific
+#end if
+
+ignoredisk --only-use=sda
+bootloader --location=mbr
+clearpart --drives=sda --all --initlabel
+part /boot/efi --fstype=efi --size=200
+part /boot --fstype=ext4 --size=512
+part / --fstype=ext4 --size=10240 --grow
+part swap --size=4000
+
+# Install
+install
+
+# Reboot After Installation
+reboot
+
+%pre
+$SNIPPET('kickstart_pre_log')
+$SNIPPET('kickstart_start')
+$SNIPPET('kickstart_pre_install_network_config')
+
+# Enable installation monitoring
+$SNIPPET('kickstart_pre_anamon')
+%end
+
+# Packages
+%packages --nobase
+@core
+iproute
+# ntp
+openssh-clients
+# wget
+# yum-plugin-priorities
+json-c
+libestr
+rsyslog
+parted
+# vim
+# lsof
+# strace
+# if $os_version == "rhel7"
+# net-tools
+# end if
+#if $getVar('tool', '') != ''
+ #set $kickstart_software = "kickstart_software_%s" % $tool
+$SNIPPET($kickstart_software)
+#end if
+%end
+
+%post --log=/var/log/post_install.log
+$SNIPPET('kickstart_post_log')
+$SNIPPET('kickstart_post_install_kernel_options')
+$SNIPPET('kickstart_post_install_network_config')
+
+chkconfig iptables off
+chkconfig ip6tables off
+
+$SNIPPET('kickstart_yum')
+$SNIPPET('kickstart_ssh')
+# $SNIPPET('kickstart_ntp')
+$SNIPPET('kickstart_limits.conf')
+$SNIPPET('kickstart_sysctl.conf')
+$SNIPPET('kickstart_rsyslog.conf')
+#if $getVar('tool', '') != ''
+ #set $kickstart_tool = "kickstart_%s" % $tool
+$SNIPPET($kickstart_tool)
+#end if
+$SNIPPET('kickstart_post_anamon')
+$SNIPPET('kickstart_done')
+%end
diff --git a/deploy/adapters/cobbler/snippets/kickstart_done b/deploy/adapters/cobbler/snippets/kickstart_done
index 2a936ad..aafcd76 100644
--- a/deploy/adapters/cobbler/snippets/kickstart_done
+++ b/deploy/adapters/cobbler/snippets/kickstart_done
@@ -17,7 +17,7 @@
## PXE JUST ONCE
#if $pxe_just_once in [ "1", "true", "yes", "y" ]
#if $breed == 'redhat'
- #set nopxe = "\nwget \"http://%s/cblr/svc/op/nopxe/system/%s\" -O /var/log/nopxe" % (srv, system_name)
+ #set nopxe = "\ncurl \"http://%s/cblr/svc/op/nopxe/system/%s\" -O /var/log/nopxe" % (srv, system_name)
#else if $breed == 'vmware' and $os_version == 'esx4'
#set nopxe = "\ncurl \"http://%s/cblr/svc/op/nopxe/system/%s\" -o /var/log/nopxe" % (srv, system_name)
#else if $breed == 'vmware'
diff --git a/deploy/compass_conf/adapter/ansible_kubernetes.conf b/deploy/compass_conf/adapter/ansible_kubernetes.conf
index 7b8023c..a3ab671 100644
--- a/deploy/compass_conf/adapter/ansible_kubernetes.conf
+++ b/deploy/compass_conf/adapter/ansible_kubernetes.conf
@@ -3,5 +3,5 @@ DISPLAY_NAME = 'Kubernetes'
PARENT = 'general'
PACKAGE_INSTALLER = 'ansible_installer_kubernetes'
OS_INSTALLER = 'cobbler'
-SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-16\.04', '(?i)CentOS-7.*16.*']
+SUPPORTED_OS_PATTERNS = ['(?i)ubuntu-16\.04', '(?i)CentOS-7.*16.*', '(?i)CentOS-7.*arm.*']
DEPLOYABLE = True
diff --git a/deploy/compass_conf/os/centos7.3.aarch64.conf b/deploy/compass_conf/os/centos7.3.aarch64.conf
new file mode 100755
index 0000000..bd3bce3
--- /dev/null
+++ b/deploy/compass_conf/os/centos7.3.aarch64.conf
@@ -0,0 +1,3 @@
+NAME = 'CentOS-7-Minimal-1611-arm-arm'
+PARENT = 'CentOS'
+DEPLOYABLE = True
diff --git a/deploy/compass_conf/os/ubuntu16.04.aarch64.conf b/deploy/compass_conf/os/ubuntu16.04.aarch64.conf
new file mode 100755
index 0000000..986c039
--- /dev/null
+++ b/deploy/compass_conf/os/ubuntu16.04.aarch64.conf
@@ -0,0 +1,3 @@
+NAME = 'ubuntu-16.04-server-arm-arm64-arm'
+PARENT = 'Ubuntu'
+DEPLOYABLE = True
diff --git a/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1611-arm-arm/profile.tmpl b/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1611-arm-arm/profile.tmpl
new file mode 100755
index 0000000..cfa8900
--- /dev/null
+++ b/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1611-arm-arm/profile.tmpl
@@ -0,0 +1,3 @@
+{
+ "repos": "$getVar('repo_name', '')"
+}
diff --git a/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1611-arm-arm/system.tmpl b/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1611-arm-arm/system.tmpl
new file mode 100755
index 0000000..8e4cbbb
--- /dev/null
+++ b/deploy/compass_conf/templates/cobbler/CentOS-7-Minimal-1611-arm-arm/system.tmpl
@@ -0,0 +1,76 @@
+{
+ "name": "$hostname",
+ "hostname": "$hostname",
+ "profile": "$profile",
+ "gateway": "$gateway",
+ #import simplejson as json
+ #set nameservers = json.dumps($nameservers, encoding='utf-8')
+ "name_servers": $nameservers,
+ #set search_path = ' '.join($search_path)
+ "name_servers_search": "$search_path",
+ "proxy": "$getVar('http_proxy', '')",
+ "modify_interface":
+ #set networks = $networks
+ #set rekeyed = {}
+ #set promic_nic = ""
+ #for $nic, $val in $networks.iteritems():
+ #set ip_key = '-'.join(('ipaddress', $nic))
+ #set netmask_key = '-'.join(('netmask', $nic))
+ #set mgmt_key = '-'.join(('management', $nic))
+ #set static_key = '-'.join(('static', $nic))
+ #set $rekeyed[$ip_key] = $val.ip
+ #set $rekeyed[$netmask_key] = $val.netmask
+ #set $rekeyed[$mgmt_key] = $val.is_mgmt
+ #set $rekeyed[$static_key] = True
+
+ #set dns_key = '-'.join(('dnsname', $nic))
+ #if $val.is_mgmt
+ #set $rekeyed[$dns_key] = $dns
+ #else
+ #if '.' in $dns
+ #set $dns_name, $dns_domain = $dns.split('.', 1)
+ #set $dns_nic = '%s-%s.%s' % ($dns_name, $nic, $dns_domain)
+ #else
+ #set $dns_nic = '%s-%s' % ($dns, $nic)
+ #end if
+ #set $rekeyed[$dns_key] = $dns_nic
+ #end if
+
+ #if $val.is_promiscuous:
+ #set promic_nic = $nic
+ #end if
+ #if $val.is_mgmt:
+ #set mac_key = '-'.join(('macaddress', $nic))
+ #set $rekeyed[$mac_key] = $mac
+ #end if
+ #end for
+ #set nic_info = json.dumps($rekeyed, encoding='utf-8')
+ $nic_info
+ ,
+ "ksmeta":{
+ #set partition_config = ''
+ #for k, v in $partition.iteritems():
+ #set path = ''
+ #if v['vol_percentage']:
+ #set $path = k + ' ' + str(v['vol_percentage']) + '%'
+ #else:
+ #set $path = k + ' ' + str(v['vol_size'])
+ #end if
+ #set partition_config = ';'.join((partition_config, $path))
+ #end for
+ #set partition_config = partition_config[1:]
+ #import crypt
+ #set $password = crypt.crypt($server_credentials.password, "az")
+ #set no_proxy = ','.join($getVar('no_proxy', []))
+ "username": "$server_credentials.username",
+ "password": "$password",
+ "promisc_nics": "$promic_nic",
+ "partition": "$partition_config",
+ "https_proxy": "$getVar('https_proxy', '')",
+ "ntp_server": "$ntp_server",
+ "timezone": "$timezone",
+ "ignore_proxy": "$no_proxy",
+ "local_repo": "$getVar('local_repo', '')",
+ "disk_num": "1"
+ }
+}
diff --git a/deploy/compass_conf/templates/cobbler/ubuntu-16.04-server-arm-arm64-arm/profile.tmpl b/deploy/compass_conf/templates/cobbler/ubuntu-16.04-server-arm-arm64-arm/profile.tmpl
new file mode 100755
index 0000000..cfa8900
--- /dev/null
+++ b/deploy/compass_conf/templates/cobbler/ubuntu-16.04-server-arm-arm64-arm/profile.tmpl
@@ -0,0 +1,3 @@
+{
+ "repos": "$getVar('repo_name', '')"
+}
diff --git a/deploy/compass_conf/templates/cobbler/ubuntu-16.04-server-arm-arm64-arm/system.tmpl b/deploy/compass_conf/templates/cobbler/ubuntu-16.04-server-arm-arm64-arm/system.tmpl
new file mode 100755
index 0000000..cfcc883
--- /dev/null
+++ b/deploy/compass_conf/templates/cobbler/ubuntu-16.04-server-arm-arm64-arm/system.tmpl
@@ -0,0 +1,75 @@
+{
+ "name": "$hostname",
+ "hostname": "$hostname",
+ "profile": "$profile",
+ "gateway": "$gateway",
+ #import simplejson as json
+ #set nameservers = json.dumps($nameservers, encoding='utf-8')
+ "name_servers": $nameservers,
+ #set search_path = ' '.join($search_path)
+ "name_servers_search": "$search_path",
+ "proxy": "$getVar('http_proxy', '')",
+ "modify_interface":
+ #set networks = $networks
+ #set rekeyed = {}
+ #set promic_nic = ""
+ #for $nic, $val in $networks.iteritems():
+ #set ip_key = '-'.join(('ipaddress', $nic))
+ #set netmask_key = '-'.join(('netmask', $nic))
+ #set mgmt_key = '-'.join(('management', $nic))
+ #set static_key = '-'.join(('static', $nic))
+ #set $rekeyed[$ip_key] = $val.ip
+ #set $rekeyed[$netmask_key] = $val.netmask
+ #set $rekeyed[$static_key] = True
+
+ #set dns_key = '-'.join(('dnsname', $nic))
+ #if $val.is_mgmt
+ #set $rekeyed[$dns_key] = $dns
+ #else
+ #if '.' in $dns
+ #set $dns_name, $dns_domain = $dns.split('.', 1)
+ #set $dns_nic = '%s-%s.%s' % ($dns_name, $nic, $dns_domain)
+ #else
+ #set $dns_nic = '%s-%s' % ($dns, $nic)
+ #end if
+ #set $rekeyed[$dns_key] = $dns_nic
+ #end if
+
+ #if $val.is_promiscuous:
+ #set promic_nic = $nic
+ #end if
+ #if $val.is_mgmt:
+ #set mac_key = '-'.join(('macaddress', $nic))
+ #set $rekeyed[$mac_key] = $mac
+ #end if
+ #end for
+ #set nic_info = json.dumps($rekeyed, encoding='utf-8')
+ $nic_info
+ ,
+ "ksmeta":{
+ #set partition_config = ''
+ #for k, v in $partition.iteritems():
+ #set path = ''
+ #if v['vol_percentage']:
+ #set $path = k + ' ' + str(v['vol_percentage']) + '%'
+ #else:
+ #set $path = k + ' ' + str(v['vol_size'])
+ #end if
+ #set partition_config = ';'.join((partition_config, $path))
+ #end for
+ #set partition_config = partition_config[1:]
+ #import crypt
+ #set $password = crypt.crypt($server_credentials.password, "az")
+ #set no_proxy = ','.join($getVar('no_proxy', []))
+ "username": "$server_credentials.username",
+ "password": "$password",
+ "promisc_nics": "$promic_nic",
+ "partition": "$partition_config",
+ "https_proxy": "$getVar('https_proxy', '')",
+ "ntp_server": "$ntp_server",
+ "timezone": "$timezone",
+ "ignore_proxy": "$no_proxy",
+ "local_repo": "$getVar('local_repo', '')",
+ "disk_num": "1"
+ }
+}
diff --git a/deploy/conf/compass.conf b/deploy/conf/compass.conf
index 98ba302..dc3a975 100644
--- a/deploy/conf/compass.conf
+++ b/deploy/conf/compass.conf
@@ -18,14 +18,17 @@ export NAMESERVERS=${USER_NAMESERVER:-"$COMPASS_SERVER"}
export COMPASS_REPO_PORT="5151"
export OFFLINE_DEPLOY=${OFFLINE_DEPLOY:-'Disable'}
-export COMPASS_DECK="compass4nfv/compass-deck"
-export COMPASS_TASKS="compass4nfv/compass-tasks-osa:euphrates"
+# Set docker registry for architectures other than x86_64
+COMPASS_DOCKER_REPO=${COMPASS_DOCKER_REPO:-compass4nfv}
+
+export COMPASS_DECK="$COMPASS_DOCKER_REPO/compass-deck"
+export COMPASS_TASKS="$COMPASS_DOCKER_REPO/compass-tasks-osa:euphrates"
if [[ "x"$KUBERNETES_VERSION != "x" ]]; then
- export COMPASS_TASKS="compass4nfv/compass-tasks-k8s"
+ export COMPASS_TASKS="$COMPASS_DOCKER_REPO/compass-tasks-k8s"
fi
-export COMPASS_COBBLER="compass4nfv/compass-cobbler"
-export COMPASS_DB="compass4nfv/compass-db"
-export COMPASS_MQ="compass4nfv/compass-mq"
-export COMPASS_REPO="compass4nfv/compass-repo-osa-ubuntu:euphrates"
+export COMPASS_COBBLER="$COMPASS_DOCKER_REPO/compass-cobbler"
+export COMPASS_DB="$COMPASS_DOCKER_REPO/compass-db"
+export COMPASS_MQ="$COMPASS_DOCKER_REPO/compass-mq"
+export COMPASS_REPO="$COMPASS_DOCKER_REPO/compass-repo-osa-ubuntu:euphrates"
diff --git a/deploy/host_virtual.sh b/deploy/host_virtual.sh
index bd2f49a..03a1230 100755
--- a/deploy/host_virtual.sh
+++ b/deploy/host_virtual.sh
@@ -13,14 +13,32 @@ function tear_down_machines() {
IFS=,
for i in $HOSTNAMES; do
sudo virsh destroy $i
- sudo virsh undefine $i
+ if [ "$COMPASS_ARCH" = "aarch64" ]; then
+ # --nvram is required for UEFI enabled VM
+ sudo virsh undefine --nvram $i
+ else
+ sudo virsh undefine $i
+ fi
rm -rf $host_vm_dir/$i
done
IFS=$old_ifs
}
function reboot_hosts() {
- log_warn "reboot_hosts do nothing"
+ # We do need it for aarch64
+ if [ "$COMPASS_ARCH" = "aarch64" ]; then
+ old_ifs=$IFS
+ IFS=,
+ for i in $HOSTNAMES; do
+ sudo virsh destroy $i
+ sleep 3
+ sudo virsh start $i
+ sleep 3
+ done
+ IFS=$old_ifs
+ else
+ log_warn "reboot_hosts do nothing"
+ fi
}
function launch_host_vms() {
@@ -28,6 +46,13 @@ function launch_host_vms() {
IFS=,
#function_bod
mac_array=($machines)
+
+ # Select vm template per arch
+ vm_template_dir="$COMPASS_DIR/deploy/template/vm"
+ vm_template_file="$vm_template_dir/host.xml"
+ vm_template_arch="$vm_template_dir/host-$COMPASS_ARCH.xml"
+ [ -f $vm_template_arch ] && vm_template_file=$vm_template_arch
+
log_info "bringing up pxe boot vms"
i=0
for host in $HOSTNAMES; do
@@ -43,7 +68,7 @@ function launch_host_vms() {
-e "s/REPLACE_BOOT_MAC/${mac_array[i]}/g" \
-e "s/REPLACE_NET_INSTALL/install/g" \
-e "s/REPLACE_NET_IAAS/external_nat/g" \
- $COMPASS_DIR/deploy/template/vm/host.xml\
+ "$vm_template_file" \
> $vm_dir/libvirt.xml
sudo virsh define $vm_dir/libvirt.xml
diff --git a/deploy/prepare.sh b/deploy/prepare.sh
index 0927347..e4cfb95 100755
--- a/deploy/prepare.sh
+++ b/deploy/prepare.sh
@@ -26,6 +26,12 @@ function install_docker()
stable"
sudo apt-get update
sudo apt-get install -y docker-ce
+ sleep 5
+ sudo cat << EOF > /etc/docker/daemon.json
+{
+ "storage-driver": "devicemapper"
+}
+EOF
sudo service docker start
sudo service docker restart
@@ -134,7 +140,7 @@ function _pre_env_setup()
tar -zxvf $jhpkg_url -C $WORK_DIR/prepare/
cd $WORK_DIR/prepare/jh_env_package
- tar -zxvf trusty-jh-ppa.tar.gz
+ tar -zxvf jh-ppa.tar.gz
if [[ ! -z /etc/apt/sources.list.d ]]; then
mv /etc/apt/sources.list.d /etc/apt/sources.list.d.bak
@@ -144,7 +150,7 @@ function _pre_env_setup()
mv /etc/apt/apt.conf /etc/apt/apt.conf.bak
fi
- cat << EOF > /etc/apt/apt.conf
+ sudo cat << EOF > /etc/apt/apt.conf
APT::Get::Assume-Yes "true";
APT::Get::force-yes "true";
Acquire::http::Proxy::127.0.0.1:9998 DIRECT;
@@ -154,11 +160,17 @@ EOF
mv /etc/apt/sources.list /etc/apt/sources.list.bak
fi
- cat << EOF > /etc/apt/sources.list
-deb [arch=amd64] http://127.0.0.1:9998/trusty-jh-ppa trusty main
+ sudo cat << EOF > /etc/apt/sources.list
+deb [arch=amd64] http://127.0.0.1:9998/jh-ppa $(lsb_release -cs) main
EOF
- nohup python -m SimpleHTTPServer 9998 &
+ if [[ $(lsb_release -cs) == "trusty" ]]; then
+ nohup python -m SimpleHTTPServer 9998 &
+ else
+ nohup python3 -m http.server 9998 &
+ fi
+
+ http_ppa_pid=$!
cd -
sleep 5
@@ -172,12 +184,25 @@ EOF
sudo docker version >/dev/null 2>&1
if [[ $? -ne 0 ]]; then
- install_docker
+ sudo apt-get install -y docker-ce
+ sleep 5
+ sudo cat << EOF > /etc/docker/daemon.json
+{
+ "storage-driver": "devicemapper"
+}
+EOF
+
+ sudo service docker start
+ sudo service docker restart
+ else
+ StorageDriver=$(sudo docker info | grep "Storage Driver" | awk '{print $3}')
+ if [[ $StorageDriver != "devicemapper" ]]; then
+ echo "The storage driver of docker currently only supports 'devicemapper'."
+ exit 1
+ fi
fi
- pid=$(ps -ef | grep SimpleHTTPServer | grep 9998 | awk '{print $2}')
- echo $pid
- kill -9 $pid
+ kill -9 $http_ppa_pid
if [[ ! -d /etc/libvirt/hooks ]]; then
sudo mkdir -p /etc/libvirt/hooks
@@ -210,8 +235,6 @@ function _pre_pip_setup()
mkdir -p ~/.pip
fi
-# rm -rf ~/.pip
-# mkdir -p ~/.pip
rm -rf $WORK_DIR/prepare
mkdir -p $WORK_DIR/prepare
jhpkg_url=${JHPKG_URL:7}
@@ -223,7 +246,7 @@ function _pre_pip_setup()
tar -zxvf $jhpkg_url -C $WORK_DIR/prepare/
cd $WORK_DIR/prepare/jh_env_package
- tar -zxvf env_trusty_pip.tar.gz
+ tar -zxvf jh_pip.tar.gz
cat << EOF > ~/.pip/pip.conf
[global]
@@ -233,7 +256,14 @@ no-index = true
trusted-host=127.0.0.1
EOF
- nohup python -m SimpleHTTPServer 9999 &
+ if [[ $(lsb_release -cs) == "trusty" ]]; then
+ nohup python -m SimpleHTTPServer 9999 &
+ else
+ nohup python3 -m http.server 9999 &
+ fi
+
+ http_pip_pid=$!
+ echo $http_pip_pid
sleep 5
@@ -244,25 +274,27 @@ EOF
virtualenv $WORK_DIR/venv
source $WORK_DIR/venv/bin/activate
- #pip install --upgrade cffi
-
- PIP="cffi MarkupSafe pip cheetah pyyaml requests netaddr oslo.config ansible"
-
- #PIP="paramiko jinja2 PyYAML setuptools pycrypto pyasn1 cryptography MarkupSafe idna six enum34 ipaddress pycparser virtualenv cheetah requests netaddr pbr oslo.config ansible"
- for i in ${PIP}; do
- pip install --upgrade $i
- done
+ pip install cffi==1.10.0
+ pip install MarkupSafe==1.0
+ pip install pip==9.0.1
+ pip install cheetah==2.4.4
+ pip install pyyaml==3.12
+ pip install requests==2.18.1
+ pip install netaddr==0.7.19
+ pip install oslo.config==4.6.0
+ pip install ansible==2.3.1.0
+ sudo pip install docker-compose==1.14.0
+ if [[ $(lsb_release -cs) == "xenial" ]]; then
+ sudo pip install -U pyOpenSSL
+ fi
- pid=$(ps -ef | grep SimpleHTTPServer | grep 9999 | awk '{print $2}')
- echo $pid
- kill -9 $pid
+ kill -9 $http_pip_pid
if [[ -f ~/.pip/pip.conf.bak ]]; then
mv ~/.pip/pip.conf.bak ~/.pip/pip.conf
else
rm -rf ~/.pip/pip.conf
fi
-# rm -rf ~/.pip/pip.conf
}
function prepare_python_env()
diff --git a/deploy/template/vm/host-aarch64.xml b/deploy/template/vm/host-aarch64.xml
new file mode 100644
index 0000000..7f32a19
--- /dev/null
+++ b/deploy/template/vm/host-aarch64.xml
@@ -0,0 +1,58 @@
+<domain type='kvm'>
+ <name>REPLACE_NAME</name>
+ <memory unit='MiB'>REPLACE_MEM</memory>
+ <currentMemory unit='MiB'>REPLACE_MEM</currentMemory>
+ <vcpu placement='static'>REPLACE_CPU</vcpu>
+ <os>
+ <type arch='aarch64' machine='virt'>hvm</type>
+ <loader readonly='yes' type='pflash'>/usr/share/AAVMF/AAVMF_CODE.fd</loader>
+ <boot dev='hd'/>
+ <boot dev='network'/>
+ </os>
+ <features>
+ <gic version='2'/>
+ </features>
+ <cpu mode='host-passthrough'/>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
+ <disk type='file' device='disk'>
+ <driver name='qemu' type='raw'/>
+ <source file='REPLACE_IMAGE'/>
+ <target dev='sda' bus='scsi'/>
+ </disk>
+ <controller type='scsi' index='0' model='virtio-scsi'>
+ <address type='virtio-mmio'/>
+ </controller>
+ <interface type='network'>
+ <mac address=REPLACE_BOOT_MAC/>
+ <source network='REPLACE_NET_INSTALL'/>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
+ </interface>
+ <interface type='network'>
+ <source network='REPLACE_NET_IAAS'/>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
+ </interface>
+ <interface type='network'>
+ <source network='default'/>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
+ </interface>
+ <interface type='network'>
+ <source network='default'/>
+ <model type='virtio'/>
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
+ </interface>
+ <serial type='pty'>
+ <target port='0'/>
+ </serial>
+ <console type='pty'>
+ <target type='serial' port='0'/>
+ </console>
+ </devices>
+</domain>