def setup_volumes(self):
for img_file in ('overcloud-full.vmlinuz', 'overcloud-full.initrd',
self.image_name):
src_img = os.path.join(self.image_path, img_file)
if img_file == self.image_name:
dest_img = os.path.join(constants.LIBVIRT_VOLUME_PATH,
'undercloud.qcow2')
else:
dest_img = os.path.join(constants.LIBVIRT_VOLUME_PATH,
img_file)
if not os.path.isfile(src_img):
raise ApexUndercloudException(
"Required source file does not exist:{}".format(src_img))
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.
评论列表
文章目录