[ 0.0] Create overlay file in /home/syoshida/tmp/ to protect source disk • [ 0.0] Examine source disk • virt-sparsify: error: libguestfs error: could not create appliance through • libvirt. • Try running qemu directly without libvirt using this environment variable: • export LIBGUESTFS_BACKEND=direct • Original error from libvirt: Cannot access storage file • '/home/syoshida/tmp/libguestfsDpkgQX/overlay1.qcow2' (as uid:107, gid:107): • Permission denied [code=38 int1=13] • If reporting bugs, run virt-sparsify with debugging enabled and include the • complete output: • virt-sparsify -v -x [...] # 何故か動かない LIBGUESTFS_BACKENDと言うのを指定してみるといいらしい?
foo_sparsify.qcow2 • [ 0.0] Create overlay file in /home/syoshida/tmp/ to protect source disk • [ 0.0] Examine source disk • [ 2.4] Fill free space in /dev/sda1 with zero • 100% ⟦▒▒▒▒▒▒▒▒⟧ 00:00 • [ 114.0] Clearing Linux swap on /dev/sda2 • 100% ⟦▒▒▒▒▒▒▒▒⟧ 00:00 • [ 131.0] Fill free space in /dev/sda3 with zero • ◒ 13% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒══════════════════════════════════════════════════════════════════ • ══════════════════════════════════════════════════════════⟧ 35:38 • virt-sparsify: error: libguestfs error: appliance closed the connection • unexpectedly. • This usually means the libguestfs appliance crashed. • Do: • export LIBGUESTFS_DEBUG=1 LIBGUESTFS_TRACE=1 • and run the command again. For further information, read: • http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs • You can also run 'libguestfs-test-tool' and post the *complete* output • into a bug report or message to the libguestfs mailing list. • If reporting bugs, run virt-sparsify with debugging enabled and include the • complete output: • virt-sparsify -v -x [...] # デバックオプション&トレース取れ?
order=0, oom_score_adj=0 • [ 627.159593] Out of memory and no killable processes... • [ 627.160151] Kernel panic - not syncing: System is deadlocked on memory • https://bugzilla.redhat.com/show_bug.cgi?id=914934 – Bug 914934 - oom-killer kills guestfsd when tar-in a lot of data • https://bugzilla.redhat.com/show_bug.cgi?id=866994 – Bug 866994 - tgz-out causes memory leak in guestfsd
guestfish in RHEL? • Facing issue with KVM guest as qemu is getting killed due to out of memory. • Default memsize of guestfish is 500M in RHEL, how to increase it? • (後は契約者のみ)
we tried to choose • + * a minimal memory size, but this isn't really necessary since • + * recent QEMU and KVM don't do anything nasty like locking • + * memory into core any more. Thus we can safely choose a • + * large, generous amount of memory, and it'll just get swapped • + * on smaller systems. • + */ • + str = getenv ("LIBGUESTFS_MEMSIZE"); • + if (str) { • + if (sscanf (str, "%d", &g->memsize) != 1 || g->memsize <= 256) { • + fprintf (stderr, "libguestfs: non-numeric or too small value for LIBGUESTFS_MEMSIZE¥n"); • + goto error; • + } • + } else • + g->memsize = 500; • + • http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=3d15f7e652340777514ff30c3cfc560a90b6 12ec • デフォルト500Mがハードコードされてるのを確認
sparse • [4677.7] Sparsify operation completed with no errors. • virt-sparsify: Before deleting the old disk, carefully check that the • target disk boots and works correctly. • real 78m25.609s • user 46m17.532s • sys 700m35.423s • 11時間40分!なお実行したマシンはSSD + EPYC # ps • PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND • 10138 root 20 0 25.2g 20.0g 19080 R 680.1 8.0 27:26.83 qemu-kvm