copr: aarch64 hypervisor documentation fix
This commit is contained in:
parent
a3bae57b0e
commit
edac7114e8
3 changed files with 49 additions and 4 deletions
14
roles/copr_hypervisor_aarch64/files/download
Executable file
14
roles/copr_hypervisor_aarch64/files/download
Executable file
|
@ -0,0 +1,14 @@
|
|||
#! /bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
for name in \
|
||||
builder-repositories.repo \
|
||||
download \
|
||||
prepare-disk \
|
||||
promote-disk \
|
||||
upload-disk; \
|
||||
do
|
||||
curl https://infrastructure.fedoraproject.org/cgit/ansible.git/plain/roles/copr_hypervisor_aarch64/files/"$name" \
|
||||
> "$name"
|
||||
done
|
26
roles/copr_hypervisor_aarch64/files/promote-disk
Executable file
26
roles/copr_hypervisor_aarch64/files/promote-disk
Executable file
|
@ -0,0 +1,26 @@
|
|||
#! /bin/sh -x
|
||||
|
||||
die() { echo >&2 "$*" ; exit 1 ; }
|
||||
|
||||
volume_promoted=$1
|
||||
volume=copr-builder
|
||||
|
||||
# the only pool where we can work with qcow2 images (which is effective,
|
||||
# compared to raw images)
|
||||
pool=images
|
||||
|
||||
new_volume=copr-builder-$(date +"%Y%m%d_%H%M%S")
|
||||
|
||||
connections='
|
||||
qemu:///system
|
||||
qemu+ssh://copr@virthost-aarch64-os02.fedorainfracloud.org/system
|
||||
'
|
||||
|
||||
test -n "$volume" || die "first argument (volume) required"
|
||||
|
||||
for connection in $connections; do
|
||||
virsh --connect="$connection" vol-delete "$volume" --pool "$pool"
|
||||
virsh --connect="$connection" vol-clone "$volume_promoted" "$volume" --pool "$pool"
|
||||
done
|
||||
|
||||
echo "copr-builder == $volume_promoted now"
|
|
@ -4,8 +4,12 @@ die() { echo >&2 "$*" ; exit 1 ; }
|
|||
image=$1
|
||||
|
||||
volume=copr-builder
|
||||
|
||||
# the only pool where we can work with qcow2 images (which is effective,
|
||||
# compared to raw images)
|
||||
pool=images
|
||||
backup_volume=copr-builder-$(date +"%Y%m%d_%H%M%S")
|
||||
|
||||
new_volume=copr-builder-$(date +"%Y%m%d_%H%M%S")
|
||||
|
||||
connections='
|
||||
qemu:///system
|
||||
|
@ -18,7 +22,8 @@ test -n "$image" || die "first argument (image) required"
|
|||
test -f "$image" || die "image $image not found"
|
||||
|
||||
for connection in $connections; do
|
||||
export VIRSH_DEFAULT_CONNECT_URI=$connection
|
||||
virsh vol-clone "$volume" "$backup_volume" --pool "$pool"
|
||||
virsh vol-upload "$volume" --sparse --pool "$pool" "$image"
|
||||
virsh --connect="$connection" vol-create-as --pool "$pool" "$new_volume" 1M
|
||||
virsh --connect="$connection" vol-upload --pool "$pool" "$new_volume" --sparse "$image"
|
||||
done
|
||||
|
||||
echo "uploaded images $new_volume"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue