Skip to content

Instantly share code, notes, and snippets.

@goneri
Created September 12, 2018 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goneri/961e34956171a5d35c50d440054eba96 to your computer and use it in GitHub Desktop.
Save goneri/961e34956171a5d35c50d440054eba96 to your computer and use it in GitHub Desktop.
refresh openstack-full image with virt-customize
export LIBGUESTFS_BACKEND=direct
sudo yum install -y libguestfs-tools
cp overcloud-full.qcow2 overcloud-full.tmp.qcow2
virt-customize \
--memsize 2000 \
--add overcloud-full.tmp.qcow2 \
--sm-credentials "$login:password:$password" \
--sm-register \
--sm-attach "pool:$pool_id" \
--upload /etc/yum.repos.d/dci_repo.repo:/etc/yum.repos.d/dci_repo.repo \
--update \
--sm-remove \
--sm-unregister \
--selinux-relabel
mv overcloud-full.qcow2 overcloud-full.up_to_date.qcow2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment