diff --git a/cluster/libvirt-coreos/util.sh b/cluster/libvirt-coreos/util.sh index e591f5ac3d2..bba4e79f61f 100644 --- a/cluster/libvirt-coreos/util.sh +++ b/cluster/libvirt-coreos/util.sh @@ -25,7 +25,7 @@ export LIBVIRT_DEFAULT_URI=qemu:///system export SERVICE_ACCOUNT_LOOKUP=${SERVICE_ACCOUNT_LOOKUP:-false} export ADMISSION_CONTROL=${ADMISSION_CONTROL:-NamespaceLifecycle,LimitRanger,ServiceAccount,ResourceQuota} readonly POOL=kubernetes -readonly POOL_PATH="$(cd $ROOT && pwd)/libvirt_storage_pool" +readonly POOL_PATH=/var/lib/libvirt/images/kubernetes # join # Concatenates the list elements with the delimiter passed as first parameter @@ -130,12 +130,11 @@ function initialize-pool { if [[ "$ROOT/coreos_production_qemu_image.img.bz2" -nt "$POOL_PATH/coreos_base.img" ]]; then bunzip2 -f -k "$ROOT/coreos_production_qemu_image.img.bz2" virsh vol-delete coreos_base.img --pool $POOL 2> /dev/null || true - mv "$ROOT/coreos_production_qemu_image.img" "$POOL_PATH/coreos_base.img" fi - # if ! virsh vol-list $POOL | grep -q coreos_base.img; then - # virsh vol-create-as $POOL coreos_base.img 10G --format qcow2 - # virsh vol-upload coreos_base.img "$ROOT/coreos_production_qemu_image.img" --pool $POOL - # fi + if ! virsh vol-list $POOL | grep -q coreos_base.img; then + virsh vol-create-as $POOL coreos_base.img 10G --format qcow2 + virsh vol-upload coreos_base.img "$ROOT/coreos_production_qemu_image.img" --pool $POOL + fi mkdir -p "$POOL_PATH/kubernetes" kube-push-internal