Update prestage playbooks for optimal results
In this commit:
- Switch to rsync from ansible copy to download packages from
the system controller. This improves the packages prestage
performance by an order of magnitude for single subcloud prestage
and by 20% for a batch subcloud prestage.
- Reduce image bundle size to ensure there is ample headroom for
images import from archive during simplex subcloud restore/upgrade.
- Increase the minimum docker available space required for prestage.
Test Plan:
- Verify successful single subcloud prestage using dcmanager subcloud
prestage command.
- Verify successful batch subcloud prestage using dcmanager prestage
orchestration.
- Verify successful subcloud upgrade post prestage.
Story: 2009799
Task: 44769
Change-Id: I155d01cc15db8dd5f8c1bc4c5355d53897d3c7cf
Signed-off-by: Tee Ngo <Tee.Ngo@windriver.com>
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
platform_backup_dir: /opt/platform-backup
|
||||
image_list: []
|
||||
# Max image bundle size in bytes
|
||||
bundle_size: 8000000000
|
||||
bundle_size: 4000000000
|
||||
|
||||
roles:
|
||||
- prestage/prepare-env
|
||||
|
||||
@@ -157,17 +157,12 @@
|
||||
shell: df -h /var/lib/docker|tail -n +2|awk '{print $4}'
|
||||
register: avail_space_check
|
||||
|
||||
# Fail if the available docker space is below 10G
|
||||
# Fail if the available docker space is below 16G
|
||||
- name: Fail if available docker space is below the minimum required
|
||||
fail:
|
||||
msg: "Available docker space is below the minimum required space for images prestage."
|
||||
when: (avail_space_check.stdout[-1] != 'G' or
|
||||
avail_space_check.stdout[:-1]|int < 10)
|
||||
|
||||
- name: Reduce max bundle size if docker space is less than 16G
|
||||
set_fact:
|
||||
bundle_size: 4000000000
|
||||
when: avail_space_check.stdout[:-1]|int < 16
|
||||
avail_space_check.stdout[:-1]|int < 16)
|
||||
|
||||
- block:
|
||||
- name: Verify that the images list file exists if provided
|
||||
|
||||
@@ -55,28 +55,25 @@
|
||||
--files-from={{ prestage_dir }}/common_packages.txt
|
||||
{{ packages_prestage_dir }}
|
||||
|
||||
# TODO(tngo): Check if the rsync method below is faster than ansible fileglob
|
||||
# copy for batch subcloud prestage in large DC. Also consider limiting rsync
|
||||
# bandwidth with --bwlimit option.
|
||||
# - name: Download new packages to prestage directory on {{ inventory_hostname }}
|
||||
# shell: >
|
||||
# sshpass -p {{ ansible_ssh_pass }}
|
||||
# rsync -a -e 'ssh -o StrictHostKeyChecking=no'
|
||||
# sysadmin@registry.central:{{ packages_download_source }}/* {{ packages_prestage_dir }}
|
||||
# register: rpm_transfer
|
||||
# retries: 3
|
||||
# delay: 2
|
||||
# until: rpm_transfer.rc == 0
|
||||
# no_log: true
|
||||
|
||||
- name: Download new packages to prestage directory on {{ inventory_hostname }}
|
||||
copy:
|
||||
src: "{{ item }}"
|
||||
dest: "{{ packages_prestage_dir }}"
|
||||
owner: root
|
||||
mode: 0644
|
||||
with_fileglob:
|
||||
- "{{ packages_download_source }}/*.rpm"
|
||||
shell: >
|
||||
sshpass -p {{ ansible_ssh_pass }}
|
||||
rsync -a -e 'ssh -o StrictHostKeyChecking=no'
|
||||
sysadmin@registry.central:{{ packages_download_source }}/* {{ packages_prestage_dir }}
|
||||
register: rpm_transfer
|
||||
retries: 3
|
||||
delay: 2
|
||||
until: rpm_transfer.rc == 0
|
||||
no_log: true
|
||||
|
||||
# - name: Download new packages to prestage directory on {{ inventory_hostname }}
|
||||
# copy:
|
||||
# src: "{{ item }}"
|
||||
# dest: "{{ packages_prestage_dir }}"
|
||||
# owner: root
|
||||
# mode: 0644
|
||||
# with_fileglob:
|
||||
# - "{{ packages_download_source }}/*.rpm"
|
||||
|
||||
- name: Generate prestage repodata
|
||||
command: createrepo -g {{ comps_file | basename }} .
|
||||
|
||||
Reference in New Issue
Block a user