20160213 centos and fedora kvm diffs - plembo/onemoretech GitHub Wiki
title: CentOS and Fedora KVM diffs link: https://onemoretech.wordpress.com/2016/02/13/centos-and-fedora-kvm-diffs/ author: phil2nc description: post_id: 10700 created: 2016/02/13 17:29:59 created_gmt: 2016/02/13 22:29:59 comment_status: closed post_name: centos-and-fedora-kvm-diffs status: publish post_type: post
CentOS and Fedora KVM diffs
Had occasion to migrate some test virtual machines from a Fedora 23 server to CentOS 7 machine today. Yeah. There are differences. (Note that because guests on the new host would need to be accessible from other clients on my network I set up a bridge (br0) on the new server, with physical interface eth0 as one of its slaves. This would give me the flexibility in the future to define additional experimental virtual networks on the machine without compromising access to the server host. Thought I was being clever on this one. Did an export of the machine configs to xml using: [code language="bash" gutter="false"] virsh dumpxml guest1 >guest1.xml [/code] Then I made sure all the guests on the old server were down and stayed that way: [code language="bash" gutter="false"] virsh destroy guest1 virsh destroy guest2 virsh destroy guest3 virsh autostart --disable guest1 virsh autostart --disable guest2 virsh autostart --disable guest3 [/code] Then I copied those .xml files and the qcow2 disk images files from the old server to the new. Since the disk images would be located along the same exact path on the new server as they had on the old, I didn't think I'd need to edit those .xml files. So I went ahead and defined the first guest: [code language="bash" gutter="false"] virsh define --file guest1.xml [/code] Oh good. No errors. [code language="bash" gutter="false"] virsh start guest1 [/code] Bang. An error. [code language="bash" gutter="false"] error: Cannot check QEMU binary /usr/bin/qemu-kvm: No such file or directory [/code] Oh. After Googling around a bit I had to resort to comparing the two hosts, and found that qemu-kvm is indeed under /usr/bin on Fedora 23, but on CentOS 7 it's under /usr/libexec. WHAAT? Really? Was it so necessary to move the executable like that? Or, better yet, to have originally located it in such an odd place? Once I fixed the path in the .xml files to reflect the actual location of qemu-kvm on the new host, I undefined and then redefined the guest and tried starting again. [code language="bash" gutter="false"] qemu-kvm: -machine pc-i440fx-2.3,accel=kvm,usb=off: Unsupported machine type [/code] Right. Of course. Turns out guests created on CentOS 7 have the machine type "pc-i440fx-rhel7.0.0" instead of "pc-i440fx-2.3" (the "2.3" undoubtedly standing for Fedora 2-3). A bit more editing of my .xml files, another undefine, define and start. Success! To make sure the guests would restart on every new boot of the underlying host I of course did a "virsh autostart guestN" for each. You learn something new every day in the tech business. Sometimes even when you don't want to.
Copyright 2004-2019 Phil Lembo