ubuntu 14.04 + CloudStack 4.3 を試みる.. その3 : KVM (未完・未推敲・箇条)

この記事は公開されてから時間が経っています

KVM 顛末

. sudo aptitude install qemu-kvm libvirt-bin virtinst bridge-utils

. /etc/modules

. sudo modprobe kvm

user@ubuntuCST:~$ cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

lp
rtc
vhost_net
kvm_intel
kvm

user@ubuntuCST:~$ lsmod | grep kvm
kvm_intel             143060  0
kvm                   451511  1 kvm_intel
user@ubuntuCST:~$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used
user@ubuntuCST:~$

. interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual

auto br0
iface br0 inet static
    address 172.16.205.70
    netmask 255.255.0.0
    gateway 172.16.XXX.XXX
    bridge_ports     eth0
    bridge_stp       off

Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.13.0-24-generic x86_64)

* Documentation:  https://help.ubuntu.com/

  System information as of Tue May 27 11:10:53 JST 2014

  System load:  0.2               Processes:             359
  Usage of /:   8.6% of 74.44GB   Users logged in:       0
  Memory usage: 10%               IP address for br0:    172.16.205.70
  Swap usage:   0%                IP address for virbr0: 192.168.122.1

  Graph this data and manage this system at:
    https://landscape.canonical.com/

Last login: Tue May 27 11:10:54 2014 from xxxxx4.localnet
user@ubuntuCST:~$

 

user@ubuntuCST:~$ ifconfig -a
br0       Link encap:Ethernet  HWaddr 00:0c:29:c7:96:6f
          inet addr:172.16.205.70  Bcast:172.16.255.255  Mask:255.255.0.0
          inet6 addr: fe80::20c:29ff:fec7:966f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7955 errors:0 dropped:572 overruns:0 frame:0
          TX packets:240 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:532933 (532.9 KB)  TX bytes:29877 (29.8 KB)
eth0      Link encap:Ethernet  HWaddr 00:0c:29:c7:96:6f
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:235737 errors:0 dropped:5 overruns:0 frame:0
          TX packets:240 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:265610272 (265.6 MB)  TX bytes:30087 (30.0 KB)
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:2884 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2884 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:233624 (233.6 KB)  TX bytes:233624 (233.6 KB)
virbr0    Link encap:Ethernet  HWaddr 22:9d:02:8e:2d:14
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
user@ubuntuCST:~$

user@ubuntuCST:~$ sudo emacs base
user@ubuntuCST:~$ sudo aptitude install ubuntu-desktop
user@ubuntuCST:~$ sudo aptitude install ubuntu-vm-builder
user@ubuntuCST:~$ sudo aptitude install cpu-checker
user@ubuntuCST:~$ sudo aptitude install virt-manager
user@ubuntuCST:~$ sudo aptitude install virt-viewer virt-goodies virt-top

user@ubuntuCST:~$ sudo /usr/bin/qemu-img create -f qcow2 /home/ubuntustdio.qcow2 20G

sudo virt-install --connect=qemu:///system --name=mint --hvm --accelerate --disk path=/home/ubuntustdio.qcow2,size=80,device=disk,bus=virtio,format=qcow2 --ram=2048 --cdrom ./Downloads/linuxmint-16-cinnamon-dvd-nocodecs-32bit.iso --network network=default,model=virtio --vnc --os-type=linux --os-variant=ubuntuprecise --livecd --noacpi

user@ubuntuCST:~$ virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     mint                           shut off

user@ubuntuCST:~$

user@ubuntuCST:~$ virsh destroy mint

user@ubuntuCST:~$ sudo virsh start mint
[sudo] password for user:
ドメイン mint が起動されました

user@ubuntuCST:~$ sudo virsh list
 Id    名前                         状態
----------------------------------------------------
 6     mint                           実行中

user@ubuntuCST:~$ sudo virsh shutdown mint
ドメイン mint はシャットダウン中です

user@ubuntuCST:~$ sudo virsh list
 Id    名前                         状態
----------------------------------------------------

user@ubuntuCST:~$ sudo virsh list --all
 Id    名前                         状態
----------------------------------------------------
 -     mint                           シャットオフ

user@ubuntuCST:~$

user@ubuntuCST:~$ sudo virt-install –connect=qemu:///system –name win2k –hvm –accelerate –disk path=/home/W2K.qcow  –ram=2048 –network network=default,model=virtio –vnc –os-type=windows –os-variant=win2k –boot hd

インストールの開始中…
ドメインを作成中…                                                                      |    0 B     00:00     
仮想マシンの作成が完了しました。
次のコマンドを実行することにより、仮想マシンを再起動できます:
  virsh –connect qemu:///system start win2k
user@ubuntuCST:~$

user@ubuntuCST:/mnt/hgfs/VMWare Share/T2/w2k$ sudo qemu-img convert -O qcow2 w2k.vmdk /home/w2k.qcow2
[sudo] password for user:
user@ubuntuCST:/mnt/hgfs/VMWare Share/T2/w2k$

vSphere から OAV 出力して変換してみた

user@ubuntuCST:/mnt/hgfs/VMWare Share/T2/vista$ sudo virt-install –connect=qemu:///system –name=vista –hvm –accelerate –disk path=/home/vista.qcow2 –ram 2048 –os-type=windows –os-variant=vista –import

インストールの開始中…
ドメインを作成中…                                                           |    0 B     00:04
ドメイン vista に接続しました
エスケープ文字は ^] です

仮想マシンの作成が完了しました。
次のコマンドを実行することにより、仮想マシンを再起動できます:

調整中