Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[21.05] restore-single-files: reduce chance of UUID collision #1083

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -34,12 +34,12 @@ rec {
megacli = callPackage ./megacli { };
multiping = callPackage ./multiping.nix {};
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
Loading