Always update OVS to 2.9.2
[apex.git] / apex / overcloud / deploy.py
index c526a98..39ddd6e 100644 (file)
@@ -205,6 +205,8 @@ def create_deploy_cmd(ds, ns, inv, tmp_dir,
             else:
                 deploy_options.append(os.path.join(con.THT_ENV_DIR, v))
 
+    # TODO(trozet) Fix this check to look for if ceph is in controller services
+    # and not use name of the file
     if ds_opts['ceph'] and 'csit' not in env_file:
         prep_storage_env(ds, ns, virtual, tmp_dir)
         deploy_options.append(os.path.join(con.THT_ENV_DIR,
@@ -245,12 +247,16 @@ def create_deploy_cmd(ds, ns, inv, tmp_dir,
     if net_data:
         cmd += ' --networks-file network_data.yaml'
     libvirt_type = 'kvm'
-    if virtual:
+    if virtual and (platform.machine() != 'aarch64'):
         with open('/sys/module/kvm_intel/parameters/nested') as f:
             nested_kvm = f.read().strip()
             if nested_kvm != 'Y':
                 libvirt_type = 'qemu'
+    elif virtual and (platform.machine() == 'aarch64'):
+        libvirt_type = 'qemu'
     cmd += ' --libvirt-type {}'.format(libvirt_type)
+    if platform.machine() == 'aarch64':
+        cmd += ' --override-ansible-cfg /home/stack/ansible.cfg '
     logging.info("Deploy command set: {}".format(cmd))
 
     with open(os.path.join(tmp_dir, 'deploy_command'), 'w') as fh:
@@ -356,21 +362,10 @@ def prep_image(ds, ns, img, tmp_dir, root_pw=None, docker_tag=None,
         virt_cmds.append({con.VIRT_PW: pw_op})
 
     if dataplane == 'ovs':
-        if ds_opts['sfc']:
-            oc_builder.inject_ovs_nsh(tmp_oc_image, tmp_dir)
-        elif sdn == 'opendaylight':
-            # FIXME(trozet) remove this after RDO is updated with fix for
-            # https://bugzilla.redhat.com/show_bug.cgi?id=1544892
-            ovs_file = os.path.basename(con.CUSTOM_OVS)
-            ovs_url = con.CUSTOM_OVS.replace(ovs_file, '')
-            utils.fetch_upstream_and_unpack(dest=tmp_dir, url=ovs_url,
-                                            targets=[ovs_file])
-            virt_cmds.extend([
-                {con.VIRT_UPLOAD: "{}:/root/".format(os.path.join(tmp_dir,
-                                                                  ovs_file))},
-                {con.VIRT_RUN_CMD: "yum downgrade -y /root/{}".format(
-                    ovs_file)}
-            ])
+        # FIXME(trozet) remove this after RDO is updated with fix for
+        # https://bugzilla.redhat.com/show_bug.cgi?id=1544892
+        # https://review.rdoproject.org/r/#/c/13839/
+        oc_builder.inject_ovs_nsh(tmp_oc_image, tmp_dir)
 
     if dataplane == 'fdio':
         # Patch neutron with using OVS external interface for router
@@ -430,6 +425,29 @@ def prep_image(ds, ns, img, tmp_dir, root_pw=None, docker_tag=None,
     virt_cmds.append(
         {con.VIRT_RUN_CMD: "crudini --del {} Unit "
                            "ConditionPathExists".format(dhcp_unit)})
+    # Prep for NFS
+    virt_cmds.extend([
+        {con.VIRT_INSTALL: "nfs-utils"},
+        {con.VIRT_RUN_CMD: "ln -s /usr/lib/systemd/system/nfs-server.service "
+                           "/etc/systemd/system/multi-user.target.wants/"
+                           "nfs-server.service"},
+        {con.VIRT_RUN_CMD: "mkdir -p /glance"},
+        {con.VIRT_RUN_CMD: "mkdir -p /cinder"},
+        {con.VIRT_RUN_CMD: "mkdir -p /nova"},
+        {con.VIRT_RUN_CMD: "chmod 777 /glance"},
+        {con.VIRT_RUN_CMD: "chmod 777 /cinder"},
+        {con.VIRT_RUN_CMD: "chmod 777 /nova"},
+        {con.VIRT_RUN_CMD: "chown nfsnobody:nfsnobody /glance"},
+        {con.VIRT_RUN_CMD: "chown nfsnobody:nfsnobody /cinder"},
+        {con.VIRT_RUN_CMD: "chown nfsnobody:nfsnobody /nova"},
+        {con.VIRT_RUN_CMD: "echo '/glance *(rw,sync,"
+                           "no_root_squash,no_acl)' > /etc/exports"},
+        {con.VIRT_RUN_CMD: "echo '/cinder *(rw,sync,"
+                           "no_root_squash,no_acl)' >> /etc/exports"},
+        {con.VIRT_RUN_CMD: "echo '/nova *(rw,sync,"
+                           "no_root_squash,no_acl)' >> /etc/exports"},
+        {con.VIRT_RUN_CMD: "exportfs -avr"},
+    ])
     virt_utils.virt_customize(virt_cmds, tmp_oc_image)
     logging.info("Overcloud image customization complete")
     return patched_containers