LoginSignup
3
4

More than 5 years have passed since last update.

SoftLayerの無料ベアメタルでOpenStackの学習をする(5) - reboot後のアクセスとNested KVMの確認

Last updated at Posted at 2015-03-18

前回はこちら - 次回はこちら


これはなに

「OpenStackクラウドインテグレーション オープンソースクラウドによるサービス構築入門」の実習をSoftLayerの無料ベアメタルで行う記録である。
OpenStackクラウドインテグレーション オープンソースクラウドによるサービス構築入門

Nested KVMとiptablesの設定確認

実はサーバーをrebootしたところアクセスできなくなった。いくら待っても、PublicもPrivateもどちらからもアクセスできない。sshはもちろんpingにも応答が無い orz。 確認したいこともあったので、OSのRELOADから再挑戦。OSのRELOADは、SoftLayerのポータルからボタンひとつで完了する。

今回は、環境の変化を確認しながら、すこしずつ行っていく。
今回、書きたいのは、SoftLayerの無料ベアメタルでOpenStackの学習をする(2) - サーバー環境の確認とDevStack環境の用意2.4.3 ホストLinuxの環境設定2.4.4 ホストLinuxの環境設定の仮想ネットワーク作成までの部分。

Reload直後

まず、Nested KVMの設定の確認。設定ファイルはなく、初期導入時は、nested=N になっている。


root@test:~# ls /etc/modprobe.d/kvm-nested.conf
ls: cannot access /etc/modprobe.d/kvm-nested.conf: No such file or directory
root@test:~# cat /sys/module/kvm_intel/parameters/nested
N

ubuntuでは、iptablesが初期導入・起動されるがルールはなし。


root@test:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

まずは、更新。


root@test:~# sudo apt-get update
root@test:~# sudo apt-get -y upgrade

ここでも、Nested KVMやiptablesの設定変更なし。

virtinstの導入

virtinstを導入


root@test:~# sudo apt-get -y install virtinst

設定ファイルは無いが、nested=Nのままだか、iptablesのルールが変わっている。


root@test:~# cat /sys/module/kvm_intel/parameters/nested
N

root@test:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootps
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:bootps

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             192.168.122.0/24     ctstate RELATED,ESTABLISHED
ACCEPT     all  --  192.168.122.0/24     anywhere
ACCEPT     all  --  anywhere             anywhere
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootpc

リブートしてみる


root@test:~# reboot

Broadcast message from root@test
        (/dev/pts/0) at 0:24 ...

The system is going down for reboot NOW!

再接続に、問題ない。

qemu-kvmの導入

qemu-kvm を導入する


root@test:~# sudo apt-get -y install qemu-kvm

設定ファイルはできていないが、nested=Yになっている。


root@test:~# ls /etc/modprobe.d/kvm-nested.conf
ls: cannot access /etc/modprobe.d/kvm-nested.conf: No such file or directory
root@test:~# cat /sys/module/kvm_intel/parameters/nested
Y

仮想ネットワークの作成

gitをいれ、サポートファイルを導入する。


root@test:~# sudo apt-get -y install git
root@test:~# git clone https://github.com/josug-book1-materials/ubuntu-virtinst.git

openstack.xmlで仮想ネットワークを作成する。作成用のシェルも用意されている。


root@test:~/ubuntu-virtinst/network# ./net-define.sh
Network openstack defined from openstack.xml

Network openstack started

Network openstack marked as autostarted

 Name                 State      Autostart     Persistent
----------------------------------------------------------
 default              active     yes           yes
 openstack            active     yes           yes

iptablesのルールが追加されている。


root@test:~# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootps
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:bootps
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootps
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:bootps

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             192.168.100.0/24     ctstate RELATED,ESTABLISHED
ACCEPT     all  --  192.168.100.0/24     anywhere
ACCEPT     all  --  anywhere             anywhere
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable
ACCEPT     all  --  anywhere             192.168.122.0/24     ctstate RELATED,ESTABLISHED
ACCEPT     all  --  192.168.122.0/24     anywhere
ACCEPT     all  --  anywhere             anywhere
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable
REJECT     all  --  anywhere             anywhere             reject-with icmp-port-unreachable

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootpc
ACCEPT     udp  --  anywhere             anywhere             udp dpt:bootpc

もう一度、リブートしてみる。


root@test:~# reboot

Broadcast message from root@test
        (/dev/pts/1) at 1:13 ...

The system is going down for reboot NOW!

いくら待っても、PublicもPrivateもどちらからもアクセスできない。sshはもちろんpingにも応答が無い orz。 VPNで接続して、IPMIインターフェースにアクセスしてコンソールを見ると、もちろん起動している。結局、IPMIのコンソールから、iptablesのルールをいじって外部アクセスからのアクセスを可能にした。


次回は本当に5章に進みたい。


前回はこちら - 次回はこちら

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4