[root@localhost conf.d]# su -s /bin/bash nginx
bash-4.2$ ssh-copy-id [email protected] #kvm02机的免密
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/var/lib/nginx/.ssh/id_rsa.pub"
The authenticity of host '10.0.0.143 (10.0.0.143)' can't be established.
ECDSA key fingerprint is SHA256:N99fAx5OoDgmMhJEIaDDT4aPn4cusNFjs5xCmD9cDwc.
ECDSA key fingerprint is MD5:e3:d3:fc:9b:51:56:0d:20:5b:16:1e:1c:b4:38:a1:38.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.
bash-4.2$ ssh-copy-id [email protected] #kvm03机器免密
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/var/lib/nginx/.ssh/id_rsa.pub"
The authenticity of host '10.0.0.143 (10.0.0.143)' can't be established.
ECDSA key fingerprint is SHA256:N99fAx5OoDgmMhJEIaDDT4aPn4cusNFjs5xCmD9cDwc.
ECDSA key fingerprint is MD5:e3:d3:fc:9b:51:56:0d:20:5b:16:1e:1c:b4:38:a1:38.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.
yum install libvirt* virt-* qemu-kvm* -y
[root@kvm02 ~]# yum install libvirt* virt-* qemu-kvm* -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 9.4 kB 00:00:00
* base: mirrors.aliyun.com
* epel: mirrors.yun-idc.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
epel | 5.3 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/2): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(2/2): epel/x86_64/primary_db | 6.9 MB 00:00:02
Package libvirt-glib-1.0.0-1.el7.x86_64 already installed and latest version
Package libvirt-daemon-driver-storage-logical-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-driver-qemu-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-driver-storage-core-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-driver-nwfilter-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-driver-lxc-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-driver-secret-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-config-nwfilter-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-driver-storage-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-driver-interface-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-bash-completion-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-driver-storage-mpath-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-python-4.5.0-1.el7.x86_64 already installed and latest version
Package libvirt-daemon-driver-storage-gluster-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-driver-storage-disk-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-driver-storage-scsi-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-client-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-config-network-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-driver-network-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-libs-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-kvm-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-driver-storage-rbd-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-driver-storage-iscsi-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package libvirt-daemon-driver-nodedev-4.5.0-23.el7_7.3.x86_64 already installed and latest version
Package virt-manager-common-1.5.0-7.el7.noarch already installed and latest version
Package virt-manager-1.5.0-7.el7.noarch already installed and latest version
Package virt-install-1.5.0-7.el7.noarch already installed and latest version
Package virt-what-1.18-4.el7.x86_64 already installed and latest version
Package virt-viewer-5.0-15.el7.x86_64 already installed and latest version
Package 10:qemu-kvm-common-1.5.3-167.el7_7.1.x86_64 already installed and latest version
Package 10:qemu-kvm-1.5.3-167.el7_7.1.x86_64 already installed and latest version
#次数省略N多行
Dependency Installed:
OVMF.noarch 0:20180508-6.gitee3198e672e2.el7
PyYAML.x86_64 0:3.10-11.el7
augeas.x86_64 0:1.4.0-9.el7
copy-jdk-configs.noarch 0:3.3-10.el7_5
giflib.x86_64 0:4.1.6-9.el7
glib2-devel.x86_64 0:2.56.1-5.el7
gtk2.x86_64 0:2.24.31-1.el7
java-1.8.0-openjdk.x86_64 1:1.8.0.232.b09-0.el7_7
java-1.8.0-openjdk-headless.x86_64 1:1.8.0.232.b09-0.el7_7
javapackages-tools.noarch 0:3.4.1-11.el7
jna.x86_64 0:3.5.2-8.el7
libcmpiutil.x86_64 0:0.5.7-3.el7
libfontenc.x86_64 0:1.1.3-3.el7
libguestfs-winsupport.x86_64 0:7.2-3.el7
libxml2-devel.x86_64 0:2.9.1-6.el7_2.3
libyaml.x86_64 0:0.1.4-11.el7_0
lksctp-tools.x86_64 0:1.0.17-2.el7
lm_sensors-libs.x86_64 0:3.4.0-8.20160601gitf9185e5.el7
m2crypto.x86_64 0:0.21.1-17.el7
nbdkit.x86_64 0:1.8.0-1.el7
nbdkit-plugin-python-common.x86_64 0:1.8.0-1.el7
nbdkit-plugin-python2.x86_64 0:1.8.0-1.el7
nbdkit-plugin-vddk.x86_64 0:1.8.0-1.el7
net-snmp-agent-libs.x86_64 1:5.7.2-43.el7
net-snmp-libs.x86_64 1:5.7.2-43.el7
openslp.x86_64 1:2.0.0-8.el7_7
pcre-devel.x86_64 0:8.32-17.el7
pcsc-lite-libs.x86_64 0:1.8.8-8.el7
python-dateutil.noarch 0:1.5-7.el7
python-javapackages.noarch 0:3.4.1-11.el7
python-lxml.x86_64 0:3.2.1-4.el7
python-suds.noarch 0:0.4.1-5.el7
sanlock.x86_64 0:3.7.3-1.el7
sanlock-lib.x86_64 0:3.7.3-1.el7
subscription-manager-rhsm.x86_64 0:1.24.13-3.el7.centos
subscription-manager-rhsm-certificates.x86_64 0:1.24.13-3.el7.centos
systemd-python.x86_64 0:219-67.el7_7.2
tog-pegasus.x86_64 2:2.14.1-7.el7
tog-pegasus-libs.x86_64 2:2.14.1-7.el7
ttmkfdir.x86_64 0:3.0.9-42.el7
tzdata-java.noarch 0:2019c-1.el7
unzip.x86_64 0:6.0-20.el7
xorg-x11-font-utils.x86_64 1:7.5-21.el7
xorg-x11-fonts-Type1.noarch 0:7.5-9.el7
xz-devel.x86_64 0:5.2.2-1.el7
zlib-devel.x86_64 0:1.2.7-18.el7
Dependency Updated:
glib2.x86_64 0:2.56.1-5.el7 systemd.x86_64 0:219-67.el7_7.2 systemd-libs.x86_64 0:219-67.el7_7.2
systemd-sysv.x86_64 0:219-67.el7_7.2
Complete!
#至此KVM+QEMU所有组件安装完毕!
#执行
virt-v2v -help
[root@kvm02 ~]# virt-v2v -help
virt-v2v: convert a guest to use KVM
virt-v2v -ic vpx://vcenter.example.com/Datacenter/esxi -os imported esx_guest
virt-v2v -ic vpx://vcenter.example.com/Datacenter/esxi esx_guest -o rhv -os rhv.nfs:/export_domain --network ovirtmgmt
virt-v2v -i libvirtxml guest-domain.xml -o local -os /var/tmp
virt-v2v -i disk disk.img -o local -os /var/tmp
virt-v2v -i disk disk.img -o glance
There is a companion front-end called "virt-p2v" which comes as an
ISO or CD image that can be booted on physical machines.
A short summary of the options is given below. For detailed help please
read the man page virt-v2v(1).
Options:
-b, --bridge Map bridge ‘in’ to ‘out’
--color, --colors, --colour, --colours
Use ANSI colour sequences even if not tty
--compressed Compress output file (-of qcow2 only)
--debug-overlay, --debug-overlays Save overlay files
--echo-keys Don’t turn off echo for passphrases
--help Display brief help
-i
Set input mode (default: libvirt)
-ic Libvirt URI
-if Input format (for -i disk)
-io
通过V2V方式迁移
cd /vm_data/v2v/
virt-v2v-copy-to-local -ic esx://[email protected]?no_verify=1 Centosx64_ESXi
virt-v2v -i libvirtxml Centosx64_ESXi.xml -o local -os /vm_data/v2v/ -of raw
[root@kvm02 v2v]# virt-v2v-copy-to-local -ic esx://[email protected]?no_verify=1 Centosx64_ESXi
[ 0.0] Fetching the remote libvirt XML metadata ...
2020-01-08 15:17:16.837+0000: 13731: info : libvirt version: 4.5.0, package: 23.el7_7.3 (CentOS BuildSystem , 2019-12-02-17:45:06, x86-02.bsys.centos.org)
2020-01-08 15:17:16.837+0000: 13731: info : hostname: kvm02
2020-01-08 15:17:16.837+0000: 13731: warning : esxConnectOpen:857 : Ignoring unexpected path '' for non-vpx scheme 'esx'
Enter root's password for 10.0.0.130:
[ 7.9] Parsing the remote libvirt XML metadata ...
Enter host password for user 'root':
Enter host password for user 'root':
[ 18.8] Copying remote disk 1/1 to Centosx64_ESXi-disk1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 10.0G 100 10.0G 0 0 55.6M 0 0:03:03 0:03:03 --:--:-- 50.9M
[ 202.8] Writing libvirt XML metadata to Centosx64_ESXi.xml ...
[ 202.8] Finishing off
[root@kvm02 v2v]# ls
Centosx64_ESXi-disk1 Centosx64_ESXi.xml
[root@kvm02 v2v]# virt-v2v -i libvirtxml Centosx64_ESXi.xml -o local -os /vm_data/v2v/ -of raw
[ 0.0] Opening the source -i libvirtxml Centosx64_ESXi.xml
[ 0.0] Creating an overlay to protect the source from being modified
[ 0.1] Opening the overlay
[ 4.2] Inspecting the overlay
[ 11.7] Checking for sufficient free disk space in the guest
[ 11.7] Estimating space required on target for each disk
[ 11.7] Converting CentOS Linux release 7.6.1810 (Core) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[ 41.3] Mapping filesystem data to avoid copying unused and blank areas
[ 41.8] Closing the overlay
[ 42.1] Assigning disks to buses
[ 42.1] Checking if the guest needs BIOS or UEFI to boot
[ 42.1] Initializing the target -o local -os /vm_data/v2v/
[ 42.1] Copying disk 1/1 to /vm_data/v2v/Centosx64_ESXi-sda (raw)
(100.00/100%)
[ 50.6] Creating output metadata
[ 50.6] Finishing off
迁移完毕
virsh define Centosx64_ESXi.xml
[root@kvm02 v2v]# virsh list --all
Id Name State
----------------------------------------------------
- Centos7x64_1810 shut off
- Centosx64_ESXi shut off
什么是Thrift
The Apache Thrift software framework, for scalable cross-language services development, combines a software stack with a code generation engine to build services that work efficiently and s
org.json.JSONException: No value for items
在JSON解析中会遇到一种错误,很常见的错误
06-21 12:19:08.714 2098-2127/com.jikexueyuan.secret I/System.out﹕ Result:{"status":1,"page":1,&