KVM使用virt-sysprep -d 清理机器信息报错及解决方法

Posted zhongguiyao

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了KVM使用virt-sysprep -d 清理机器信息报错及解决方法相关的知识,希望对你有一定的参考价值。

 

报错信息:

[[email protected] log]# virt-sysprep  -d  centos6-raw40 
[   0.0] Examining the guest ...
virt-sysprep: error: libguestfs error: qemu-img: 
/tmp/libguestfs6olf8r/overlay1: qemu-img exited with error status 1.
To see full error messages you may need to enable debugging.
See http://libguestfs.org/guestfs-faq.1.html#debugging-libguestfs

If reporting bugs, run virt-sysprep with debugging enabled and include the 
complete output:

  virt-sysprep -v -x [...]

因为virt-sysprep命令是libguestfs-tools工具下命令的一个,所以先查看了libguestfs-tools的版本:

[[email protected] qemu]# rpm -qa|grep libguestfs-tools
libguestfs-tools-1.28.1-1.55.el7.centos.4.noarch
libguestfs-tools-c-1.28.1-1.55.el7.centos.4.x86_64

发现版本是libguestfs-tools-1.28.1-1.55。而另外一台执行virt-sysprep -d可以成功的。所以看一下另外一台的libguestfs-tools版本:

[[email protected] ~]# virt-sysprep -V
virt-sysprep 1.36.3rhel=7,release=6.el7_4.3,libvirt
[[email protected] ~]# rpm -qa|grep libguestfs-tools
libguestfs-tools-1.36.3-6.el7_4.3.noarch
libguestfs-tools-c-1.36.3-6.el7_4.3.x86_64

发现版本是libguestfs-tools-1.36.3,于是就升级libguestfs-tools。

 

[[email protected] qemu]# yum  upgrade libguestfs-tools

 

 

 

此时发现版本为:libguestfs-tools-1.36.3

 

[[email protected] qemu]# virt-sysprep -V
virt-sysprep 1.36.3rhel=7,release=6.el7_4.3,libvirt

 

 

 

最后清理信息成功:

[[email protected] qemu]# virt-sysprep  -d centos6.5
[   0.0] Examining the guest ...
[  53.5] Performing "abrt-data" ...
[  53.5] Performing "backup-files" ...
[  54.5] Performing "bash-history" ...
[  54.6] Performing "blkid-tab" ...
[  54.6] Performing "crash-data" ...
[  54.6] Performing "cron-spool" ...
[  54.6] Performing "dhcp-client-state" ...
[  54.6] Performing "dhcp-server-state" ...
[  54.6] Performing "dovecot-data" ...
[  54.6] Performing "logfiles" ...
[  54.6] Performing "machine-id" ...
[  54.6] Performing "mail-spool" ...
[  54.6] Performing "net-hostname" ...
[  54.6] Performing "net-hwaddr" ...
[  54.6] Performing "pacct-log" ...
[  54.6] Performing "package-manager-cache" ...
[  54.6] Performing "pam-data" ...
[  54.6] Performing "passwd-backups" ...
[  54.6] Performing "puppet-data-log" ...
[  54.6] Performing "rh-subscription-manager" ...
[  54.6] Performing "rhn-systemid" ...
[  54.6] Performing "rpm-db" ...
[  54.6] Performing "samba-db-log" ...
[  54.6] Performing "script" ...
[  54.6] Performing "smolt-uuid" ...
[  54.6] Performing "ssh-hostkeys" ...
[  54.6] Performing "ssh-userdir" ...
[  54.6] Performing "sssd-db-log" ...
[  54.6] Performing "tmp-files" ...
[  54.7] Performing "udev-persistent-net" ...
[  54.7] Performing "utmp" ...
[  54.7] Performing "yum-uuid" ...
[  54.7] Performing "customize" ...
[  54.7] Setting a random seed
[  54.7] Performing "lvm-uuids" ...

 

以上是关于KVM使用virt-sysprep -d 清理机器信息报错及解决方法的主要内容,如果未能解决你的问题,请参考以下文章

初探KVM——使用libvirt的virsh管理kvm

51 kvm技术基础使用qemu-kvm管理kvm虚拟机

KVM的qemu-kvm使用

kvm系列之二:kvm日常管理

KVM虚拟化:使用qemu-kvm创建和管理虚拟机

KVM是啥?