diff options
-rw-r--r-- | apex/deploy.py | 13 | ||||
-rw-r--r-- | apex/virtual/virtual_utils.py | 27 | ||||
-rw-r--r-- | build/opnfv-environment.yaml | 1 | ||||
-rwxr-xr-x | build/overcloud-full.sh | 14 |
4 files changed, 45 insertions, 10 deletions
diff --git a/apex/deploy.py b/apex/deploy.py index 37429773..a0561384 100644 --- a/apex/deploy.py +++ b/apex/deploy.py @@ -280,10 +280,8 @@ def main(): ansible_args = { 'virsh_enabled_networks': net_settings.enabled_network_list } - ansible_path = os.path.join(args.lib_dir, ANSIBLE_PATH) utils.run_ansible(ansible_args, - os.path.join(args.lib_dir, - ansible_path, + os.path.join(args.lib_dir, ANSIBLE_PATH, 'deploy_dependencies.yml')) uc_external = False if 'external' in net_settings.enabled_network_list: @@ -328,8 +326,7 @@ def main(): args.deploy_dir, APEX_TEMP_DIR) # Install Undercloud undercloud.configure(net_settings, - os.path.join(args.lib_dir, - ansible_path, + os.path.join(args.lib_dir, ANSIBLE_PATH, 'configure_undercloud.yml'), APEX_TEMP_DIR) @@ -344,7 +341,7 @@ def main(): overcloud_deploy.create_deploy_cmd(deploy_settings, net_settings, inventory, APEX_TEMP_DIR, args.virtual, args.env_file) - deploy_playbook = os.path.join(args.lib_dir, ansible_path, + deploy_playbook = os.path.join(args.lib_dir, ANSIBLE_PATH, 'deploy_overcloud.yml') virt_env = 'virtual-environment.yaml' bm_env = 'baremetal-environment.yaml' @@ -415,7 +412,7 @@ def main(): deploy_vars['external_network_ipv6'] = True else: deploy_vars['external_network_ipv6'] = False - post_undercloud = os.path.join(args.lib_dir, ansible_path, + post_undercloud = os.path.join(args.lib_dir, ANSIBLE_PATH, 'post_deploy_undercloud.yml') logging.info("Executing post deploy configuration undercloud playbook") try: @@ -432,7 +429,7 @@ def main(): deploy_vars['vpn'] = ds_opts['vpn'] # TODO(trozet): pull all logs and store in tmp dir in overcloud # playbook - post_overcloud = os.path.join(args.lib_dir, ansible_path, + post_overcloud = os.path.join(args.lib_dir, ANSIBLE_PATH, 'post_deploy_overcloud.yml') # Run per overcloud node for node, ip in deploy_vars['overcloud_nodes'].items(): diff --git a/apex/virtual/virtual_utils.py b/apex/virtual/virtual_utils.py index 255d2c69..1fe2c399 100644 --- a/apex/virtual/virtual_utils.py +++ b/apex/virtual/virtual_utils.py @@ -14,6 +14,7 @@ import os import platform import pprint import subprocess +import xml.etree.ElementTree as ET from apex.common import utils from apex.virtual import configure_vm as vm_lib @@ -26,6 +27,28 @@ DEFAULT_PASS = 'password' DEFAULT_VIRT_IP = '192.168.122.1' +def get_virt_ip(): + try: + virsh_net_xml = subprocess.check_output(['virsh', 'net-dumpxml', + 'default'], + stderr=subprocess.STDOUT) + except subprocess.CalledProcessError: + logging.warning('Unable to detect default virsh network IP. Will ' + 'use 192.168.122.1') + return DEFAULT_VIRT_IP + + tree = ET.fromstring(virsh_net_xml) + ip_tag = tree.find('ip') + if ip_tag: + virsh_ip = ip_tag.get('address') + if virsh_ip: + logging.debug("Detected virsh default network ip: " + "{}".format(virsh_ip)) + return virsh_ip + + return DEFAULT_VIRT_IP + + def generate_inventory(target_file, ha_enabled=False, num_computes=1, controller_ram=DEFAULT_RAM, arch=platform.machine(), compute_ram=DEFAULT_RAM, vcpus=4): @@ -42,7 +65,7 @@ def generate_inventory(target_file, ha_enabled=False, num_computes=1, """ node = {'mac_address': '', - 'ipmi_ip': DEFAULT_VIRT_IP, + 'ipmi_ip': get_virt_ip(), 'ipmi_user': DEFAULT_USER, 'ipmi_pass': DEFAULT_PASS, 'pm_type': 'pxe_ipmitool', @@ -86,7 +109,7 @@ def host_setup(node): vbmc_manager = vbmc_lib.VirtualBMCManager() for name, port in node.items(): vbmc_manager.add(username=DEFAULT_USER, password=DEFAULT_PASS, - port=port, address=DEFAULT_VIRT_IP, domain_name=name, + port=port, address=get_virt_ip(), domain_name=name, libvirt_uri='qemu:///system', libvirt_sasl_password=False, libvirt_sasl_username=False) diff --git a/build/opnfv-environment.yaml b/build/opnfv-environment.yaml index 5b5d4500..7da252ec 100644 --- a/build/opnfv-environment.yaml +++ b/build/opnfv-environment.yaml @@ -132,6 +132,7 @@ parameter_defaults: - OS::TripleO::Services::NeutronVppAgent - OS::TripleO::Services::OVNDBs - OS::TripleO::Services::Vpp + - OS::TripleO::Services::NeutronBgpvpnApi ComputeServices: - OS::TripleO::Services::Barometer - OS::TripleO::Services::CACerts diff --git a/build/overcloud-full.sh b/build/overcloud-full.sh index cc335c82..b7711a06 100755 --- a/build/overcloud-full.sh +++ b/build/overcloud-full.sh @@ -115,6 +115,18 @@ enabled=1 gpgcheck=0 EOF +# Kubernetes Repo +cat > ${BUILD_DIR}/kubernetes.repo << EOF +[kubernetes] +name=Kubernetes +baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64 +enabled=1 +gpgcheck=1 +repo_gpgcheck=1 +gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg + https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg +EOF + # Get Real Time Kernel from kvm4nfv populate_cache $kvmfornfv_uri_base/$kvmfornfv_kernel_rpm @@ -136,6 +148,7 @@ LIBGUESTFS_BACKEND=direct virt-customize \ --upload ${BUILD_DIR}/puppet-fdio.tar.gz:/etc/puppet/modules \ --run-command "cd /etc/puppet/modules && tar xzf puppet-fdio.tar.gz" \ --upload ${BUILD_DIR}/fdio.repo:/etc/yum.repos.d/ \ + --upload ${BUILD_DIR}/kubernetes.repo:/etc/yum.repos.d/ \ --run-command "mkdir /root/fdio" \ --upload ${BUILD_DIR}/noarch/$netvpp_pkg:/root/fdio \ $fdio_pkg_str \ @@ -147,6 +160,7 @@ LIBGUESTFS_BACKEND=direct virt-customize \ --install python2-networking-sfc \ --install python-etcd,puppet-etcd \ --install patch \ + --install docker,kubelet,kubeadm,kubectl,kubernetes-cni \ -a overcloud-full_build.qcow2 # upload and install barometer packages |