Skip to content

Commit

Permalink
Merge pull request #1083 from flyingcircusio/PL-132849-tmp-uuids-duri…
Browse files Browse the repository at this point in the history
…ng-restore

[21.05] restore-single-files: reduce chance of UUID collision
  • Loading branch information
ctheune authored Aug 26, 2024
2 parents fd93945 + 1c54f6c commit 2fd6063
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion nixos/roles/kvm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ in
supportsContainers = fclib.mkDisableDevhostSupport;
mkfsXfsFlags = lib.mkOption {
type = with lib.types; nullOr str;
# XXX: reflink=0 can be removed when 15.09 is out. See #PL-130977
# XXX: reflink=0 can be removed when 15.09 is gone. See PL-130977
# XXX: set reflink=0 to make file systems compatible with NixOS 15.09
# XXX: set bigtime=1 once 15.09 and 20.09 are gone. See PL-130365.
default = "-q -f -K -m crc=1,finobt=1,reflink=0 -d su=4m,sw=1";
};
migrationBandwidth = lib.mkOption {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/fc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ rec {
multiping = callPackage ./multiping.nix {};
ping-on-tap = callPackage ./ping-on-tap {};
qemu-nautilus = callPackage ./qemu rec {
version = "1.4.3";
version = "1.4.4";
src = pkgs.fetchFromGitHub {
owner = "flyingcircusio";
repo = "fc.qemu";
rev = version;
hash = "sha256-1kMdHXjsxxIW0bEV6PfDeagdLVxZP87kPKm0Z4ZtXJA=";
hash = "sha256-JyKToKWrkA1GT8GtayDyXHZvp2/UzrFFNednAavax2w=";
};
qemu_ceph = pkgs.qemu-ceph-nautilus;
ceph_client = pkgs.ceph-nautilus.ceph-client;
Expand Down
7 changes: 7 additions & 0 deletions pkgs/restore-single-files/restore-single-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ while [ ! -e $LOOPPART ]; do
sleep 0.2
done

info "Pre-mounting image to flush log"
mount -oloop ${LOOPPART} $LOOPMNT
umount $LOOPMNT

info "Regenerating UUID to avoid collisions"
xfs_admin -U generate ${LOOPPART}

info "Mounting image"
mount -oloop ${LOOPPART} $LOOPMNT

Expand Down
7 changes: 7 additions & 0 deletions tests/kvm_host_ceph-nautilus.nix
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ in
with subtest("Initialize first mon"):
host1.succeed('fc-ceph osd prepare-journal /dev/vdb')
host1.execute('systemctl stop fc-ceph-mon')
host1.execute('systemctl reset-failed fc-ceph-mon')
host1.execute('fc-ceph mon create --no-encrypt --size 500m --bootstrap-cluster > /dev/kmsg 2>&1')
host1.sleep(5)
host1.succeed('ceph -s > /dev/kmsg 2>&1')
Expand Down Expand Up @@ -452,6 +454,11 @@ in
host1.succeed("rbd pool init rbd.hdd")
host1.succeed("rbd create --size 100 rbd.hdd/fc-21.05-dev")
host1.succeed("rbd map rbd.hdd/fc-21.05-dev")
host1.succeed("sgdisk /dev/rbd0 -o -a 2048 -n 1:8192:0 -c 1:ROOT -t 1:8300")
host1.succeed("partprobe")
host1.succeed("mkfs.xfs /dev/rbd0p1")
host1.succeed("rbd unmap /dev/rbd0")
host1.succeed("rbd snap create rbd.hdd/fc-21.05-dev@v1")
host1.succeed("rbd snap protect rbd.hdd/fc-21.05-dev@v1")
Expand Down

0 comments on commit 2fd6063

Please sign in to comment.