wrapping up deploy items for aarch
[apex.git] / apex / undercloud / undercloud.py
index abbe3ff..452e497 100644 (file)
@@ -61,13 +61,14 @@ class Undercloud:
         if self.external_net:
             networks.append('external')
         console = 'ttyAMA0' if platform.machine() == 'aarch64' else 'ttyS0'
+        root = 'vda' if platform.machine() == 'aarch64' else 'sda'
 
         self.vm = vm_lib.create_vm(name='undercloud',
                                    image=self.volume,
                                    baremetal_interfaces=networks,
                                    direct_boot='overcloud-full',
                                    kernel_args=['console={}'.format(console),
-                                                'root=/dev/sda'],
+                                                'root=/dev/{}'.format(root)],
                                    default_network=True,
                                    template_dir=self.template_path)
         self.setup_volumes()
@@ -150,7 +151,8 @@ class Undercloud:
             if os.path.exists(dest_img):
                 os.remove(dest_img)
             shutil.copyfile(src_img, dest_img)
-
+            shutil.chown(dest_img, user='qemu', group='qemu')
+            os.chmod(dest_img, 0o0744)
         # TODO(trozet):check if resize needed right now size is 50gb
         # there is a lib called vminspect which has some dependencies and is
         # not yet available in pip.  Consider switching to this lib later.