월간 보관물: 2016 12월

redhat openstack director 10 install

아… 몇달전에 OpenStack Platform 8을 번역 했었는데… 이번에서야 osp director 10 설치 해봤다.

수요일 부터 토요일 까지 쭉 이거에만 매달려서 삽질 한것같다. 다음에는 이런 삽질을 하지 않을려고 여기에다 기록으로 남긴다. 생각해보니 4일 밖에 안되네 ㅋㅋ ; 짧은것 같지만 일도안하고 이거에만 매달려 있었으니 꽤 긴시간이다 ㅎㅎ(설치 건 몇개 해결하고 나서 약간 할 일이 없는 시간이었다. ㅋㅋ)

아마도 주변에서 같이 하는사람들이 몇명 있어서 도움이 많이 됐던것 같다.

일단 내가 test한 환경은 다음과 같다.

  • 32GB memory를 갖고 있는 노트북 1

1대에서 가상머신들을 만들어서 모든 test를 다 하였다. ㅋㅋ 회사에서 일 많이 하라고 사준 laptop인데 정말 잘 쓰고 있다. cpu는 좋으면 좋을 수록 test가 빨라져서 좋겠지만… i5-6200U CPU @ 2.30GHz 이런 cpu를 쓰고 있다.

하면서 여러 blog들을 많이 봤지만 아래 blog가 가장 좋더라.

https://keithtenzer.com/2016/05/30/red-hat-openstack-platform-8-lab-configuration-using-openstack-director/

기본적으로는 access.redhat.com 에 있는 osp 10 diretor installation and usage 문서를 중심으로 진행했다.

음… 일단 처음으로 redhat osp를 설치 하려면 redhat subscription이 필요한데 이건 redhat에 가입을 하여서 openstack 평가판 subscription을 받자. 60일간은 무제한으로 계속 쓸 수 잇다.

hypervisor에서 가상머신들이 사용할 provisioning network bridge를 만들자.

youngjulee@hypervisor :~⟫ cat > /tmp/provisioning.xml <<EOF

<network>

<name>provisioning</name>

<ip address=’192.0.2.254′ netmask=’255.255.255.0′>

</ip>

</network>

EOF

가상머신 환경

osp-director

  • cpu : 2

  • mem : 8192MB

  • disk : 30GB

  • nic : 2

    • provision (192.0.2.0/24)

    • external (192.168.127.0/24)

osp-node1

  • cpu : 2

  • mem : 8192

  • disk : 40GB

  • nic : 2

    • provision (192.0.2.0/24) x 2

osp-node2

  • cpu : 2

  • mem : 4096

  • disk : 40GB

  • nic : 2

    • provision (192.0.2.0/24) x 2

가상머신들을 위와같이 생성 시키고 osp-director에만 rhel7을 설치하자.

설치가 끝나면 먼저 user를 생성한다.

directorhostnamemanager.test.dom 으로 설정하였다.

[root@manager ~]# useradd stack

[root@manager ~]# passwd stack

### sudo 사용시 password를 안쓰게 setting한다. ###

[root@manager ~]# echo “stack ALL=(root) NOPASSWD:ALL” | tee -a /etc/sudoers.d/stack

[root@manager ~]# chmod 0440 /etc/sudoers.d/stack

### 사용자를 stack 으로 바꾼다. ###

[root@manager ~]# su – stack

[stack@manager ~]$

### templateimage directory 생성 ###

[stack@manager ~]$ mkdir ~/templates ~/images

### hostname 을 설정 ###

[stack@manager ~]$ sudo hostnamectl set-hostname manager.test.dom

[stack@manager ~]$ sudo hostnamectl set-hostname –transient manager.test.dom

[stack@manager ~]$ cat /etc/hosts

127.0.0.1 manager.test.dom manager localhost localhost.localdomain localhost4 localhost4.localdomain4

### subscription 등록 ###

[stack@manager ~]$ sudo subscription-manager register

[stack@manager ~]$ sudo subscription-manager list –available –all

[stack@manager ~]$ sudo subscription-manager attach –pool=8a85f98158fbf71a0158fd01b66*****

[stack@manager ~]$ sudo subscription-manager repos –disable=*

[stack@manager ~]$ sudo subscription-manager repos –enable=rhel-7-server-rpms –enable=rhel-7-server-extras-rpms –enable=rhel-7-server-rh-common-rpms –enable=rhel-ha-for-rhel-7-server-rpms –enable=rhel-7-server-openstack-10-rpms

### update ###

[stack@manager ~]$ sudo yum update -y

[stack@manager ~]$ sudo reboot

### director package install ###

[stack@manager ~]$ sudo yum install -y python-tripleoclient

### director 설정 ###

[stack@manager ~]$ cp /usr/share/instack-undercloud/undercloud.conf.sample ~/undercloud.conf

[stack@manager ~]$ grep -iv ‘^$\|^#’ undercloud.conf

[DEFAULT]

generate_service_certificate = true

local_interface = eth1

enable_ui = true

[auth]

### test 환경이라 모두 default로 하고, 필수적으로 바꿔야만 하는것들만 바꿨다. generate_service_certificate 이것은 인증서를 자동적으로 만들어주는 항목이다. osp 10 director에서 다시 사용가능한(89에서는 잠시 못썻엇다.) director web ui를 설치하려면 인증서가 반드시 필요하다.

enable_ui 이것이 director web uienable하겠냐고 묻는것이다.

local_interface 이게 우리가 test에 사용할 provisioning network interface를 어떤 걸로 할건지 정하는거다. external network nic을 지정하면 안된다.

내가 뭘 잘못했는지 web ui는 아직 잘 안되더라. ###

### undercloud install ###

[stack@manager ~]$ openstack undercloud install

### 위에서 설정이 잘못되거나 하면 여기서 먼저 실패를 많이 하는데 /home/stack/instack/install-undercloud.log 여기에 install log가 쌓이니까 한번 확인해보자. 사실 화면에 뜨는거랑 별반 차이 없다. ㅎㅎ###

### 설치가 다 되었으면 stackrcsource 하자 ###

[stack@manager ~]$ source ~/stackrc

### overcloud node image 등록 ###

[stack@manager ~]$ sudo yum install rhosp-director-images rhosp-director-images-ipa

[stack@manager ~]$ cd ~/images

[stack@manager ~]$ for i in /usr/share/rhosp-director-images/overcloud-full-latest-10.0.tar /usr/share/rhosp-director-images/ironic-python-agent-latest-10.0.tar; do tar -xvf $i; done

[stack@manager ~]$ openstack overcloud image upload –image-path /home/stack/images/

[stack@manager ~]$ openstack image list

+————————————–+————————+——–+

| ID | Name | Status |

+————————————–+————————+——–+

| 90ae7e6f-f307-40df-9714-6be5bf68fed9 | bm-deploy-ramdisk | active |

| 9952802e-536c-411a-b65f-ce837c250a00 | bm-deploy-kernel | active |

| b8f55c8f-22cb-4181-a9d5-172b75ab4242 | overcloud-full | active |

| b3105b8f-422d-4c3e-b5ce-568dba0d0327 | overcloud-full-vmlinuz | active |

| 19f48688-5ea0-4599-86ce-af186152d58c | overcloud-full-initrd | active |

+————————————–+————————+——–+

### ipxe에 사용할 image가 잘 들어가 있나 확인 ###

[stack@manager ~]$ ls -l /httpboot

### undercloud neutron subnetdns 등록 ###

[stack@manager ~]$ neutron subnet-list

+————————————–+——+————–+———————————————+

| id | name | cidr | allocation_pools |

+————————————–+——+————–+———————————————+

| 1c701fc4-d44d-4c90-80e8-ea1173483830 | | 192.0.2.0/24 | {“start”: “192.0.2.5”, “end”: “192.0.2.24”} |

+————————————–+——+————–+———————————————+

[stack@manager ~]$ neutron subnet-update 1c701fc4-d44d-4c90-80e8-ea1173483830 –dns-nameserver 192.168.127.1

### 192.168.127.1hypervisor(laptop)iphypervisor에다가 dnsmasq돌려놔서 dns로 쓰고있다. ###

[stack@manager ~]$ neutron subnet-show 1c701fc4-d44d-4c90-80e8-ea1173483830

### dns_nameservers 확인 ###

### pxe_ssh config ###

원래 여기에 ipmi 설정이 들어가야 하는데 kvm으로 하다보니까 그게 안되서 ipmi driverpxe_ssh로 설정하고 진행을 해야한다. 여기서 위에나온 blog를 참조햇다.

youngjulee@hypervisor :~⟫ cat << EOF > /etc/polkit-1/localauthority/50-local.d/50-libvirt-user-stack.pkla

[libvirt Management Access]

Identity=unix-user:stack

Action=org.libvirt.unix.manage

ResultAny=yes

ResultInactive=yes

ResultActive=yes

EOF

youngjulee@hypervisor :~⟫ useradd stack

youngjulee@hypervisor :~⟫ passwd stack

[stack@manager ~]$ ssh-copy stack@192.168.127.1

[stack@manager ~]$ cat /tmp/nodes.txt

52:54:00:75:48:0a

52:54:00:c9:e9:fa

[stack@manager ~]$ jq . << EOF > ~/instackenv.json

{

“ssh-user”: “stack”,

“ssh-key”: “$(cat ~/.ssh/id_rsa)”,

“power_manager”: “nova.virt.baremetal.virtual_power_driver.VirtualPowerManager”,

“host-ip”: “192.168.127.1”,

“arch”: “x86_64”,

“nodes”: [

{

“pm_addr”: “192.168.127.1”,

“pm_password”: “$(cat ~/.ssh/id_rsa)”,

“pm_type”: “pxe_ssh”,

“mac”: [

“$(sed -n 1p /tmp/nodes.txt)”

],

“cpu”: “2”,

“memory”: “8192”,

“disk”: “40”,

“arch”: “x86_64”,

“pm_user”: “stack”

},

{

“pm_addr”: “192.168.127.1”,

“pm_password”: “$(cat ~/.ssh/id_rsa)”,

“pm_type”: “pxe_ssh”,

“mac”: [

“$(sed -n 2p /tmp/nodes.txt)”

],

“cpu”: “2”,

“memory”: “4096”,

“disk”: “40”,

“arch”: “x86_64”,

“pm_user”: “stack”

}

]

}

EOF

### 자동으로 instack.json file이 생성되는 script이다. ###

### overcloud에서 쓸 flavor 생성 ###

[stack@manager ~]$ for n in control compute ; do nova flavor-delete $n; done

[stack@manager ~]$ openstack flavor create –id auto –ram 8192 –disk 39 –vcpus 2 –swap 2048 control

[stack@manager ~]$ openstack flavor create –id auto –ram 4096 –disk 37 –vcpus 2 –swap 2048 compute

### disk크기는 3GB 정도 작게 설정하자. introspection 끝나고 확인 해보면 disk size40GB가 아닌 39GB로 나온다. 위에서 40GB로 잡게되면 나중에 vaild host가 없어서 배포 실패한다는 error가 뜨게된다. ###

[stack@manager ~]$ openstack flavor set –property “cpu_arch”=”x86_64” –property “capabilities:boot_option”=”local” –property “capabilities:profile”=”control” control

[stack@manager ~]$ openstack flavor set –property “cpu_arch”=”x86_64” –property “capabilities:boot_option”=”local” –property “capabilities:profile”=”compute” compute

[stack@manager ~]$ openstack baremetal import –json ~/instackenv.json

[stack@manager ~]$ openstack baremetal configure boot

[stack@manager ~]$ openstack baremetal node list

### overcloud node hardware introspecting ###

[stack@manager ~]$ for node in $(openstack baremetal node list –fields uuid -f value) ; do openstack baremetal node manage $node ; done

[stack@manager ~]$ openstack overcloud node introspect –all-manageable –provide

### introspection 현황은 아래와 같이 확인하자. ###

[stack@manager ~]$ sudo journalctl -l -u openstack-ironic-inspector -u openstack-ironic-inspector-dnsmasq -u openstack-ironic-conductor -f

### hypervisor에서도 잘켜지는지, dhcp기능은 잘 되는지, ipxe를 통해서 inspector.ipxe file은 잘 가져 오는지를 확인한다. ###

youngjulee@hypervisor :~⟫ virt-viewer osp-node1

### node tagging ###

[stack@manager ~]$ openstack baremetal node set –property capabilities=’profile:compute,boot_option:local’ be07221a-0405-4067-a00e-c86dad2b7b2f

[stack@manager ~]$ openstack baremetal node set –property capabilities=’profile:control,boot_option:local’ 853ed41c-3a4d-4e06-887a-364cee11995e

[stack@manager ~]$ openstack overcloud profiles list

### root disk 정의 ###

[stack@manager ~]$ yum install -y crudini

[stack@manager ~]$ mkdir swift-data ; cd swift-data

[stack@manager ~]$ export SWIFT_PASSWORD=`sudo crudini –get /etc/ironic-inspector/inspector.conf swift password`

[stack@manager ~]$ for node in $(ironic node-list | grep -v UUID| awk ‘{print $2}’); do swift -U service:ironic -K $SWIFT_PASSWORD download ironic-inspector inspector_data-$node; done

[stack@manager ~]$ for node in $(ironic node-list | awk ‘!/UUID/ {print $2}’); do echo “NODE: $node” ; cat inspector_data-$node | jq ‘.inventory.disks’ ; echo “—–” ; done

NODE: be07221a-0405-4067-a00e-c86dad2b7b2f

[

{

“size”: 42949672960,

“rotational”: true,

“vendor”: “ATA”,

“name”: “/dev/sda”,

“wwn_vendor_extension”: null,

“wwn_with_extension”: null,

“model”: “QEMU HARDDISK”,

“wwn”: null,

“serial”: “QM00001”

}

]

—–

NODE: 853ed41c-3a4d-4e06-887a-364cee11995e

[

{

“size”: 42949672960,

“rotational”: true,

“vendor”: “0x1af4”,

“name”: “/dev/vda”,

“wwn_vendor_extension”: null,

“wwn_with_extension”: null,

“model”: “”,

“wwn”: null,

“serial”: null

}

]

—–

### 사실 root disk1개만 있을 때는 궂이 설정해줄 필요는 없는데 여러개의 disk가 있을 때 특정 disk를 설정diskroot로 쓸 수가 있다. 위에나온 정보들중에 하나를 이용해서 지정 할 수 있다. ###

[stack@manager ~]$ openstack baremetal node set –property root_device='{“serial”: “QM00001“}’ be07221a-0405-4067-a00e-c86dad2b7b2f

### heat template 가져오기 ###

[stack@manager ~]$ cp -av /usr/share/openstack-tripleo-heat-templates/environments/* ~/template/

### overcloud deploy ###

[stack@manager ~]$ cat overcloud-deploy.sh

openstack overcloud deploy \

–templates \

-e /home/stack/templates/environments/network-environment.yaml \

–stack youngju-cloud \

–control-scale 1 \

–compute-scale 1 \

–control-flavor control \

–compute-flavor compute \

–ntp-server pool.ntp.org \

–neutron-network-type vxlan \

–neutron-tunnel-types vxlan \

–timeout 60

[stack@manager ~]$ bash overcloud-deploy.sh

### 지금부터가 진짜 문제다. 위와 똑같이 진행 했다면 아마도 error가 안나겠지만 여러가지 이유로 deploy가 실패한다. 아래의 urltroubleshooting 하는 방법이 있는데 괜찮더라. ###

http://docs.openstack.org/developer/tripleo-docs/troubleshooting/troubleshooting-overcloud.html

tmux 사용법…

보통의 site나 이런데 가면 byobu를 쓸 환경이 안된다… 아쉽게도…

byobu가 제일 편한데… 못쓰면 그나마 tmux가 다음으로 좋더라. screen보다 tmux가 더 편했음…

byobu사용법은 저 아래… 한참아래  posting을 했다.

byobu 기본 사용법

 

man tmux 하면 사용법이 대충 나오는데…

 

입맛에 맞게 key binding을 좀 바꾸자.

~/.tmux.conf 에다가 다음을 추가해주자.

[root@centos7 ~]# cat .tmux.conf
set -g prefix C-j
unbind-key C-b
bind-key C-j send-prefix
setw -g mode-keys vi
set -g status-keys vi

setset-option의 alias이다. -g 는 global하게 적용을 하겠다는 뜻이고,

unbind-key는 기존 갖고 있는 key bind를 unbind를 하겠다는것인데, C-b가 기본 default tmux prefix key이다. 이걸 난 C-j로 고쳐서 쓴다.

bind-key는 key를 bind 해주겟다는 뜻이고…

setwset-window-option 의 alias이다.  사실 set-option이랑 set-window-option이랑 차이점을 잘 모르겠다. 그래서 그냥 best configuration file에서 배껴옴 ㅋ

mode-keys는 C-j [ 를 눌렀을 때 emacs mode로 볼 건지 vi mode 로 볼 건지 정할 수 있다. default가 emacs라서 나는 vi로 고쳐주었다.

아래가 그것이다.


# 0 is too far from ` 😉
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
setw -g mode-keys vi
setw -g mode-mouse on
setw -g monitor-activity on
bind-key v split-window -h
bind-key s split-window -v
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key H resize-pane -L 5
bind-key L resize-pane -R 5
bind-key M-j resize-pane -D
bind-key M-k resize-pane -U
bind-key M-h resize-pane -L
bind-key M-l resize-pane -R
# Vim style pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Use Alt-vim keys without prefix key to switch panes
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# No delay for escape key press
set -sg escape-time 0
# Reload tmux config
bind r source-file ~/.tmux.conf
# THEME
set -g status-bg black
set -g status-fg white
set -g window-status-current-bg white
set -g window-status-current-fg black
set -g window-status-current-attr bold
set -g status-interval 60
set -g status-left-length 30
set -g status-left '#[fg=green](#S) #(whoami)'
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'

view raw

tmux.conf

hosted with ❤ by GitHub

tmux에 들어가서 C-j (key binding을 바꾸지 않았으면 C-b) ? 를 하게되면 현재 적용되어 있는 key binding을 전부 볼 수 있다.

 

kvm(qcow2) to vmware(vmdk) v2v migration

kvm에서 vmwaremigration해봤다.

이유는… kvm에서 virtio를 설치 했는데도 이상하게 너무느리더라… 지금 안건데 zfs sync라는 property가 있는데 이놈이 zfs를 좀 많이 느려지게 한다드라. 어쩐지 top을 보면 이상하게 zfs관련해서 D state가 많더라…

암턴 그래서 기존 깔려 있던 ubuntuvmware12에다가 windows10을 옮기기로 마음먹엇다.

혹시 될까 싶어서 qemu-img tool을 이용해서 vmdk file로 변환 후 해보니까 잘된다;

별건 아니지만 그 과정을 여기서 좀 적어보고자 함.

qemu-img -O vmdk win10.qcow2 win10.vmdk

이렇게 하면 qcow2 file formatvmdk(vmware disk image format)로 바뀐다. 바꾼 후 vmware에서 기존 disk이용해서 가성머신을 만들어서 올렸다.

잘된다. !!! 이전에 남아잇던 virtio driver도 다 남겨두고 설치함. ㅇㅇ 당연한 거지만 vmware의 가상 device쓰는거랑은 아무 상관없는거라… ㅋㅋ

얼마전에 고객사에서 ovirt to hyper-v 하는 방법을 알려달래서 누가 실험해봣는데 안됏다던데… 시간나면 그것도 해봐야겟다. vmdk를 그냥 vhdx로만 바꾸면 될듯 한데

암턴 쉽게 됏다.

vmware가 좋긴 좋드라. kvm환경에서 이상하게 느렸던 것이 빠릿빠릿하게 까지는 아니지만 만족스러울 만큼 빠르게 동작한다. 앞으론 이걸 써야겟다 ㅎㅎ

tuned rhgs-random-io profile

tuned 의 rhgs-random-io profile을 살펴 보았다.

해당 configuration file들은 /usr/lib/tuned/ 아래 있다.

[root@rhgs1 tuned]# cat rhgs-random-io/tuned.conf

[main]

include=throughput-performance

[sysctl]

vm.dirty_ratio = 5

vm.dirty_background_ratio = 2

[root@rhgs1 tuned]# cat rhgs-sequential-io/tuned.conf

[main]

include=throughput-performance

[sysctl]

vm.dirty_ratio = 20

vm.dirty_background_ratio = 10

[root@rhgs1 tuned]# grep -iv ‘^$\|^#’ throughput-performance/tuned.conf

[cpu]

governor=performance

energy_perf_bias=performance

min_perf_pct=100

[disk]

readahead=>4096

[sysctl]

kernel.sched_min_granularity_ns = 10000000

kernel.sched_wakeup_granularity_ns = 15000000

vm.dirty_ratio = 40

vm.dirty_background_ratio = 10

vm.swappiness=10

[root@rhgs1 tuned]#

위와같이 rhgs-random-iorhgs-sequential-iothroughput-performanceinclude하고 있다.

[root@rhgs1 tuned]# tuned-adm profile rhgs-random-io

위의 commandrhgs-random-io profile을 적용시키면 아래와 같이 적용이 된다.

[cpu]

governor=performance

energy_perf_bias=performance

min_perf_pct=100

[disk]

readahead=>4096

[sysctl]

kernel.sched_min_granularity_ns = 10000000

kernel.sched_wakeup_granularity_ns = 15000000

vm.dirty_ratio = 5

vm.dirty_background_ratio = 2

vm.swappiness=10

기존 throughput-performance profile 에서 vm.dirty_ratiovm.dirty_background_ratio 가 덮어쓰여지게 된다.

[cpu]

### cpu 주파수(cpu 속도 schedule)에 관련된 section . ###

governor=performance

### 이는 cpu가 최고속도의 clock주파수를 사용하도록 강제시킨다. ###

energy_perf_bias=performance

### processorenerge saving 목적의 performance 희생을 하지않는다. 이것은 hardware default 값이다. ###

min_perf_pct=100

### minimum performance percentage 이다. cpu는 항상 100% power를 소모하게 된다. ###

[disk]

### disk elevator(scheduler)에 관련된 section이.###

readahead=>4096

### read-ahead 값을 4096 으로 한다. readahead 값은 512 byte sector 단위 임. main memorypagecache access할 때 access address부터 2048 KB만큼 미리 읽어온다는 의미 이다. 이것이 크게 되면 큰 file의 순차읽기의 성능이 좋아진다. ###

[sysctl]

### sysctl section 입니다. ###

kernel.sched_min_granularity_ns = 10000000

### kernel process scheduler(cfs)process에게 할당하는 cpu time의 가장 작은 단위 이다. 이는 nano second 단위이며, 위 값은 10ms 0.01초 단위로 cpu time을 할당 하겠다는 의미 이다. 기본값은 4ms이며 이값이 커질 수록 각 processcontext switching 하는 횟수가 적어져 전체적인 성능이 아주 미세하게 올라 갈 수 있다. ###

kernel.sched_wakeup_granularity_ns = 15000000

### sleep queue에서 깨어난 process, 적어도 이시간 이후에 다른 process를 선점 할 수 있다는 뜻임. 이 값을 증가시키면 최근 일어난 process가 다른 process를 선점하는데 더 오랜 기간을 기다려야함으로 반응성은 낮추고 throughput은 더 높아진다. 이 값을 감소시키면 깨어나서 좀더 빨리 다른놈을 선점할 수 있어서 반응성이 높아진다. 따라서 latency critical task를 더 잘 챙겨준다. 이것의 default5000000 이다. ###

vm.dirty_ratio = 5

### 이는 virtual memory(filepage cache)5%dirty(write 등으로 수정)되면 diskflushing 시켜라 라는 뜻이다. 이 값이 커지면 성능은 조금 좋아질지 모르나 장애시(갑자기 전원이 차단되거나..등등) data가 손상될 우려가 높아진다. ###

vm.dirty_background_ratio = 2

### 백분율로 정의 된다. 위 값은 전체 메모리의 2%dirty 되면 backgroundpdflush(dirtypage cacheflush 시켜주는 kernel thread)가 시작 된다. 기본 값은 10이. 이는 값을 2로 낮추어 좀더 data 정합성에 초점을 맞추었다. ###

vm.swappiness=10

### 이 값은 0부터 100까지의 값을 지정 할 수 있다. 이는 swap memory의 활용 수준을 조절한다.

값이 높을 수록 swap memory를 적극적으로 사용한다. 기본값은 60입니다. 만약 physical memory가 많을 경우 이 값을 낮추어 성능 향상을 꾀할 수 있다. ###

kvm windows 10 storage driver IDE to virtio change

windows 10을 설치 한 후 virtio driver를 인스톨 해봤다.

이는 이미 IDE driver를 사용하여 설치를 한것이며, 오늘 할것은 IDE -> virtiostorage driver를 옮기는 것이다.

그냥 하면 BSOD에서 INACCESSIBLE_BOOT_DEVICE 요런 message가 뜨면서 안되더라.

그래서 찾아보니까 http://superuser.com/questions/1057959/windows-10-in-kvm-change-boot-disk-to-virtio 여기에 딱 맞는 case가 있어서 따라해봤다.

The steps to follow in general are :

  1. Install the VirtIO drivers in the VM

  2. Set the system disk of the VM to use VirtIO

  3. If the VM does not boot, execute Startup Repair or even Repair Install

The procedure in detail is :

  1. Return the boot disk to IDE.

  2. Make sure the windows VM is shutdown.

  3. Download the VirtIO drivers ISO from here.

  4. Mount it on the CD drive for the VM.

  5. Add a storage device which is of the VirtIO type. The size allocation doesn’t matter since you are using it to install the drivers.

  6. Start the Windows VM. It will try to install the drivers. If it doesn’t, open the Device Manager and you should see the SCSI device listed with the exclamation point icon beside it. You can choose to update the driver and point to mounted ISO’s appropriate directory. Once installed, don’t reboot but shutdown the machine.

  7. In the virt-manager settings for Windows, change the storage type from IDE to VirtIO.

  8. You can remove the storage device you had created earlier. It is not longer needed.

  9. Start Windows, it should boot up and install the SCSI drivers. You will need to reboot after it does.

  10. If the VM does not boot but the drivers are installed, you might try to do :

    1. Startup Repair that can fix certain system problems that might prevent Windows from starting.

    2. The last solution: Repair Install while booting from the Windows 10 ISO. This will keep all applications and user settings, just refreshing Windows and boot. Use a recent Windows 10 ISO.

위의 답변에나온 action을 순서대로 따라해 주면된다.

1. 먼저 IDE 방식으로 boot disktype으로 바꾼 후 정상부팅 되게 한다.

2. 당연히 vmshutdown 상태여야 하고,

3. virtio driver를 다운로드 받는데… https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/ 이 주소에서 가장 최근것을 받으면 된다.

4. vmcdrommount해주고… 아직 켜진마라.

5. storage device를 하나 더 추가로 넣어주는데 이번엔 virtio type으로 만들자. size는 상관없다.

6. windows vm을 시작한다. 이제 mountcdrom에 있는 driver를 설치를 할건데 이때부터가 좀 중요함.

win + R’ key를 눌러서 command 입력창이 뜨면 ‘devmgmt.msc를 입력하자. 그럼 장치관리자가 뜰텐데 여기에 ‘삼각형 느낌표’가 떠있는 장치들이 몇개 보일것이다. 각각 인식되지 못하는 device들인데, 하나씩 드라이버를 설치 해주자. 이게 뭔 device 인지 확인 하려면 bash terminal에서 ‘virsh edit win10vm’ (win10vm은 가상머신 이름) 이렇게 입력해주면 해당 vm에 대한 xml format의 정보를 볼 수가 있는데, 여기에 저 장치들이 어떤것인지 나와있다. 장치관리자에서 느낌표가 뜬 장치를 더블클릭해보면 ‘위치’ 라는 곳이 보이는데 여기에 이 device가 어디에 붙어 있는지가 나와있다. ‘PCI 슬롯 9이렇게 되어 있다. 이제 virsh edit로 연 vm 정보에서 검색을 해보자. slot 9로 검색을 해보면 해당 device가 뭔지 나와있다. 나같은 경우 virtio-serialmembaloon을 설치해줬다. 설치하는 방법은 해당 느낌표뜬 장치에서 ‘드라이버 업데이트’ 를 눌르고 ‘컴퓨터에서 드라이버 소프트웨어 찾아보기’ 를 선택 한 후 ‘찾아보기’ 에서 cd mount된 곳의 해당 driverwindows version에 맞게 설치 해주면 된다.

7. 이제 다시 shutdown을 해주고, 아까 붙인 virtio storage는 떼버리자 이제 쓸모가 없음. 이제 IDE로 되어 있는 boot devicedisk bus virtio로 고친 후 재부팅을 해주자.

나는 10번까진 하지않았고 위에처럼만 해도 잘 되더라.

아참 혹시라도 display driverqxl로 되어 있을지 모르니 windows 8 이상은 cd mount한 곳에서 qxldod도 설치 해주자.

아… 근데 설치를 해도.. 느리더라… 조금 빨라진것도 같지만