• 検索結果がありません。

No09 Handson OpenStack Internal

N/A
N/A
Protected

Academic year: 2018

シェア "No09 Handson OpenStack Internal"

Copied!
72
0
0

読み込み中.... (全文を見る)

全文

(1)

基盤構築演習

Cloud Infrastructure Design and Deployment

9. 内部構造の探索演習

2017.v1

(2)

Table of contents

 本演習 All-in-One 構築 OpenStack 環境上 複数 仮想 ソー

配置 仮想 ソー う技術 実現 い 確認

 ン 環境 構築

 Nova

 Cinder

 Neutron

 ン演習

2

(3)

演習環境について

(4)

演習環境の概要

 演習用 OpenStack環境上 各自割 当 ン 内 演習 行い

o 各環境 生徒 独立

 最初 演習 実施 前 共通演習環境 構築 実施 必要 あ

 前回 演習環境 残 い 場合 演習環境 削除方法 実施 い

4

openstack

tenant-XX / student-XX tenant-YY / student-YY ・・・

物理 ー ー ワー 装置 ー

資源層

抽象化層

( )

仮想 ー ー

内部 ワー

192.168.199.0/24

共通演習環境

演習環境 演習環境

共通演習環境 構築 実施

構築: 第N回 演習環境 構築 作成

削除: 演習環境 削除方法 実施

各自 端末 操作 行う

(5)

演習環境の削除方法

各演習回の前に 前回の環境を削除す ために実施

(6)

演習環境を削除

 前回 演習環境 残 い 場合 環境 削除

6

[centos@console ~]$ nova delete openstack-single

Request to delete server openstack-single has been accepted.

[centos@console ~]$ nova list --field name

+---+---+

| ID | Name |

+---+---+

| 4aa81ca5-caa8-484c-aa34-1a9754528127 | console | +---+---+

[centos@console ~]$ PORTID1=`neutron port-list --fixed-ips ip_address=192.168.199.100 -c id -f csv --quote none | grep -v id`

[centos@console ~]$ PORTID2=`neutron port-list --fixed-ips ip_address=172.16.100.100 -c id -f csv --quote none | grep -v id`

[centos@console ~]$ neutron port-delete $PORTID1 && neutron port-delete $PORTID2

Deleted port: 6b5dcb28-899a-43fc-950f-35ae26d3a99b

Deleted port: 023dc50d-cd1c-489f-b7f0-ad65c3eb8880

[centos@console ~]$ neutron router-interface-delete Ext-Router floating-subnet

Removed interface from router Ext-Router.

[centos@console ~]$ neutron net-delete floating-net

Deleted network: floating-net

[centos@console ~]$ neutron net-list

+---+---+---+

| id | name | subnets |

+---+---+---+

| 1cc16a31-cf1d-436f-8b7f-bc463e58db88 | public | 592f49ed-2387-4cb1-8cc9-1f66bd956265 |

| 051318d6-e77b-4f9a-97fa-9735393ca32d | work-net | 2d76e242-5c1d-4759-b40c-167a0e4e1dc3 192.168.199.0/24 | +---+---+---+

[centos@console ~]$ nova keypair-delete key-for-console

[centos@console ~]$ nova keypair-delete my-key

[centos@console ~]$ nova keypair-list

+---+---+

| Name | Fingerprint | +---+---+ +---+---+

[centos@console ~]$ exit

仮想 ー ー 削除

console 削除 コ ン

ン 使え 削除

論理 ー 削除

仮想 ー ー 仮想

ワー 接続 解除

キー 削除

環境 演習共通 利用

削除

(7)

演習環境を削除

 残 演習用 ー ー 関連 ソー 削除

ン ン 削除

Floating IP 削除

キ ー 削除

(8)

演習環境を構築す 前の状態

 各演習環境 構築 前 以下 状態 い 事 確認 い

o default 以外 存在 い い

default 共通演習環境 作成

o ー 以外 ソー 存在 い い

 以下 3 画面 確認 い

o ソー や い 場合 次項 手順 削除

8

default

存在 い

Security Groups

外 消費 い い

3 存在

(9)

Stacks の確認

 以下 確認

o Orchestration → Stacks default 以外 存在 い い

default 以外 存在 い 場合 対象 削除

o 削除 default 以外 選択 Delete Stacks 押下

default

存在 い

hands-on-3

(10)

ソー 消費量の確認

 以下 確認

o Compute → Overview Limit Summary Security Groups 以外 消費

0 状態

 ソー 残 い 場合 前項 手順 Stacks 確認 不要

削除 い

 ソー 残 い 場合 次項 手順 個別 ソー 削除

10

Security Groups 以外 消費

い い 0 状態 確認

(11)

個別の ソー 削除

 ー 一覧 表示 残 い ソー 削除

o 以下 削除例

ン ン 削除

Floating IP 削除

キ ー 削除

(12)

ネッ ワー の状態

 以下 確認

o Network → Network Topology [public] - [Ext-Router] - [work-net] 状態

 余分 ソー 作成 い 場合 個別 削除

12

3 存在

(13)

第9回 演習環境の構築

(14)

タッ の起動

 左 ー Orchestration → Stacks 選択

 後 Launch Stack 押下

14

第9回

(15)

ンプ ー の指定

 Template Source URL 指定

 Template URL http://<<repo_ip>>/hands-on/09_handson.yaml 指定

o <<repo_ip>> 部分 講師 値 指定 あ

 値 設定 Next 押下

URL 選択

http://<<repo_ip>>/hands-on/09_handson.yaml

第9回

(16)

ーターの指定

Stack Name hands-on-9 入力

Password 自分 OpenStack ワー 入力

 hands-on repository server ー ー IP 入力

o IP 講師 指示 あ

16

hands-on-9

自分 OpenStack ワー

入力

ー ー IP

起動 ー ー

ワー 設定

後 ン 使用

第9回

(17)

正常終了の確認

 10分前後 作成 完了 Create Complete

o 設定 完了 待 間 後 演習 進 方 確認

 失敗 場合 hands-on-9 選択 Delete Stack 押下 削除

 後 再度作成 や 直 い

第9回

(18)

環境の確認

Network → Network Topology 選択 作成 ワー 環

境 確認

 正常 作成 完了 以下 状態 い

18

第9回

(19)

サー ーの確認

Compute → Instances 選択 作成 1 台 ー ー 情報 確

o handson9-openstack-single 前回 演習 作成 環境 同一環境 構成

o 環境上 演習 行い

第9回

(20)

ン情報の確認

 作成 ー ー ン 情報 確認

 Orchestration → Stacks → hands-on-9 → Overview 選択

o 情報 後 演習 何回 必要 新規 開い 演習

ー 進

20

第9回

(21)

ン情報

Overview 必要

情報 確認

o instance

 ー ー IP

 ー ー名

 Floating IP

 各自 ー PC IP

SSH 行い

o password

 上記 ー ー ン ワー

 ー ー名 centos

 ワー 自分 設定 値

表示

o private_key

 各 ン ン 利用

秘密鍵

 ワー 認証 行え 各PC

SSH 設定

ワー 入力 ン

可能

第9回

(22)

サンプ 環境の構築

22

(23)

サンプ 環境の論理構成図

 All-in-One 環境上 以下 ン 環境 構築

 ン 環境 OpenStack 上 う 実現 い 確認

外部ネッ ワー public

10.10.10.0/24 10.20.20.0/24 10.30.30.0/24 10.10.10.254 10.20.20.254 10.30.30.254

test-vm-1 test-vm-2 test-vm-3

boot-vol 10GB

Ext-Router Closed-Router

copy-snap-vol 10GB

OpenStack

・Libvirt/KVM

・LVM/iSCSI

・Open vSwitch/vxlan

Boot From Volume 起動 他 test-vm-1,2 同一

(24)

サンプ 環境の構築

 起動 い All-in-One環境上 ン 環境 構成 い

 準備 い ン ー 実行

o 興味 あ 方 中 確認

24

[sysuser@cn01060802 ~]$ ssh [email protected]

The authenticity of host '157.1.141.201 (157.1.141.201)' can't be established.

ECDSA key fingerprint is 5c:9c:eb:ee:cf:11:e3:a9:32:63:3f:31:29:55:72:af.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '157.1.141.201' (ECDSA) to the list of known hosts.

[email protected]'s password:

[centos@handson9-openstack-single ~]$ sudo -i

[root@handson9-openstack-single ~]# source keystonerc_admin

[root@handson9-openstack-single ~(keystone_admin)]#

[root@handson9-openstack-single ~(keystone_admin)]# nova list

[root@handson9-openstack-single ~(keystone_admin)]# neutron net-list

[root@handson9-openstack-single ~(keystone_admin)]# cinder list

[root@handson9-openstack-single ~(keystone_admin)]# openstack image list

[root@handson9-openstack-single ~(keystone_admin)]# wget reposerver/hands-on/09_handson_build_example.sh

[root@handson9-openstack-single ~(keystone_admin)]# bash ./09_handson_build_example.sh

#### waiting to boot instance ...

#### waiting to boot instance ...

| status | ACTIVE |

## associating FIP

#########

## done !

#########

handson9-openstack-single

root 切 替え

コ ン ー 出 い事 確認

ン ー 実行

(25)

サンプ 環境の構築

 実行 完了 以下 状態

o 環境構築 う い場合 以下 ン ー 実行 再度手順

実行 い

 wget reposerver/hands-on/09_handson_delete_example.sh

 bash ./reposerver/hands-on/09_handson_delete_example.sh

[root@handson9-openstack-single ~(keystone_admin)]# nova list

+---+---+---+---+---+---+

| ID | Name | Status | Task State | Power State | Networks |

+---+---+---+---+---+---+

| bfd2fbc5-ccc8-4636-9972-bdb1a9a41d46 | test-vm-1 | ACTIVE | - | Running | work-net=10.10.10.2, 172.16.100.102 |

| 04c39bf4-04a4-4d2a-b3d7-c8576d0815de | test-vm-2 | ACTIVE | - | Running | 3rd-net=10.30.30.2; 2nd-net=10.20.20.2, 172.16.100.103 |

| 65e7249c-d3c3-4d96-81ae-65902c99f7d7 | test-vm-3 | ACTIVE | - | Running | 3rd-net=10.30.30.3 |

+---+---+---+---+---+---+

[root@handson9-openstack-single ~(keystone_admin)]# neutron net-list

+---+---+---+

| id | name | subnets |

+---+---+---+

| bed720f0-1f22-4037-b8f7-e85426076031 | 3rd-net | 63d57072-58fe-43b5-b6a2-e6870c59cce9 10.30.30.0/24 |

| 5451f498-658c-47eb-a0e5-39d027d67f1c | public | 8ec6b1f6-6f4d-4f3f-8432-6b2939fc19da 172.16.100.0/24 |

| 238177bf-002d-4dcf-a533-0a616c927bd1 | work-net | b91f57c1-6110-47f0-8613-2d849be6ac96 10.10.10.0/24 |

| d945c4af-1f7e-4a9f-8b5f-8639dfe3cb3f | 2nd-net | 64e14f83-4ac8-4a45-8e37-f42096d39d75 10.20.20.0/24 | +---+---+---+

[root@handson9-openstack-single ~(keystone_admin)]# neutron router-list

+---+---+---+---+---+

| id | name | external_gateway_info | distributed | ha |

+---+---+---+---+---+

| 33412777-4ae4-4dfe-a578-6d21e535df96 | Ext-Router | {"network_id": "5451f498-658c-47eb-a0e5-39d027d67f1c", | False | False |

| | | "enable_snat": true, "external_fixed_ips": [{"subnet_id": | | |

| | | "8ec6b1f6-6f4d-4f3f-8432-6b2939fc19da", "ip_address": | | |

| | | "172.16.100.101"}]} | | |

| 834261c2-a547-4725-9416-1835d2071d25 | Closed-Router | null | False | False |

+---+---+---+---+---+

[root@handson9-openstack-single ~(keystone_admin)]# cinder list

+---+---+---+---+---+---+---+

| ID | Status | Name | Size | Volume Type | Bootable | Attached to |

+---+---+---+---+---+---+---+

| 3652c40c-a994-433e-ac83-f79fc92e5e47 | available | copy-snap-vol | 10 | - | true | |

| 80124fd6-8fbf-43e9-8072-a41acbf2d5e4 | in-use | boot-vol | 10 | - | true | 65e7249c-d3c3-4d96-81ae-65902c99f7d7 | +---+---+---+---+---+---+---+

ン ン

ー ー

4 ワー

public

(26)

allowed-address-pairs の設定

26

[root@handson9-openstack-single ~(keystone_admin)]# neutron router-list

+---+---+---+---+---+

| id | name | external_gateway_info | distributed | ha |

+---+---+---+---+---+

| d71ce8ae-f8a4-42fb-a79d-bce151e64ef7 | Ext-Router | {"network_id": "28af33bb-8836-48b6-bb93-7410ba85c35e", | False | False |

| | | "enable_snat": true, "external_fixed_ips": [{"subnet_id": | | |

| | | "7cc8bea6-32a8-4215-96c6-ac0145ed9e90", "ip_address": | | |

| | | "172.16.100.101"}]} | | |

| fa0b71a6-33fb-4c0d-b605-0df78e352581 | Closed-Router | null | False | False |

+---+---+---+---+---+ [root@handson9-openstack-single ~(keystone_admin ]# ip netns

qrouter-fa0b71a6-33fb-4c0d-b605-0df78e352581 qdhcp-de4a41f7-072c-45d3-8966-b05a1ca5bee3 qdhcp-1c24f13a-11c1-4d0c-a1d9-a6d15c73f591 qdhcp-f1cb2c6c-1f5d-4294-84f5-208d27307905 qrouter-d71ce8ae-f8a4-42fb-a79d-bce151e64ef7

[root@handson9-openstack-single ~(keystone_admin)]# ip netns exec qrouter-d71ce8ae-f8a4-42fb-a79d-bce151e64ef7 ip addr 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo

valid_lft forever preferred_lft forever inet6 ::1/128 scope host

valid_lft forever preferred_lft forever

8: qg-b4d03d80-17: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN qlen 1000 link/ether fa:16:3e:fc:52:1e brd ff:ff:ff:ff:ff:ff

inet 172.16.100.101/24 brd 172.16.100.255 scope global qg-b4d03d80-17 valid_lft forever preferred_lft forever

inet 172.16.100.102/32 brd 172.16.100.102 scope global qg-b4d03d80-17 valid_lft forever preferred_lft forever

inet 172.16.100.103/32 brd 172.16.100.103 scope global qg-b4d03d80-17 valid_lft forever preferred_lft forever

inet6 fe80::f816:3eff:fefc:521e/64 scope link valid_lft forever preferred_lft forever

10: qr-3e08908f-80: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN qlen 1000 link/ether fa:16:3e:59:8b:8f brd ff:ff:ff:ff:ff:ff

inet 10.10.10.254/24 brd 10.10.10.255 scope global qr-3e08908f-80 valid_lft forever preferred_lft forever

inet6 fe80::f816:3eff:fe59:8b8f/64 scope link valid_lft forever preferred_lft forever

12: qr-d0dc8764-d5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN qlen 1000 link/ether fa:16:3e:b3:c3:22 brd ff:ff:ff:ff:ff:ff

inet 10.20.20.254/24 brd 10.20.20.255 scope global qr-d0dc8764-d5 valid_lft forever preferred_lft forever

inet6 fe80::f816:3eff:feb3:c322/64 scope link valid_lft forever preferred_lft forever

Ext-Router UUID 確認

Ext-Router 対応

ー 確認

ー ー 内

172.16.100.xx IP

持 ン ー ー MACULAR

確認

MAC

(27)

allowed-address-pairs の設定

 ー ー 切 替え 演習 OpenStack 操作

[root@handson9-openstack-single ~(keystone_admin)]# su - centos

[centos@handson9-openstack-single ~]$ wget reposerver/hands-on/openrc

[centos@handson9-openstack-single ~]$ vi openrc

[centos@handson9-openstack-single ~]$ source openrc

[centos@handson9-openstack-single ~]$ neutron port-list -F id -F fixed_ips

+---+---+

| id | fixed_ips |

+---+---+

| 4ed1d937-4387-4418-87c9-3d616aa9fb56 | {"subnet_id": "ed249599-7370-411e-8f86-72f0b9083f17", "ip_address": "172.16.100.100"} |

| | {"subnet_id": "ed249599-7370-411e-8f86-72f0b9083f17", "ip_address": "172.16.100.101"} |

| | {"subnet_id": "ed249599-7370-411e-8f86-72f0b9083f17", "ip_address": "172.16.100.102"} |

| | {"subnet_id": "ed249599-7370-411e-8f86-72f0b9083f17", "ip_address": "172.16.100.103"} |

| | {"subnet_id": "ed249599-7370-411e-8f86-72f0b9083f17", "ip_address": "172.16.100.104"} |

| 871a9b6b-40ac-42ea-a9e5-ca0fa38c3edb | {"subnet_id": "cafe729e-832c-4dcc-98b3-766ad33daa4e", "ip_address": "192.168.199.100"} |

| ba017b39-4ae2-4578-a7c7-edf1522e063a | {"subnet_id": "cafe729e-832c-4dcc-98b3-766ad33daa4e", "ip_address": "192.168.199.1"} |

| df823b95-9473-42ae-a461-95bc6ac73b81 | {"subnet_id": "ed249599-7370-411e-8f86-72f0b9083f17", "ip_address": "172.16.100.254"} |

| e3107018-691d-4da8-a3ff-94f98a903092 | {"subnet_id": "cafe729e-832c-4dcc-98b3-766ad33daa4e", "ip_address": "192.168.199.254"} | +---+---+

[centos@console ~]$ neutron port-update 4ed1d937-4387-4418-87c9-3d616aa9fb56 \

--allowed-address-pairs type=dict list=true \

mac_address=fa:16:3e:fc:52:1e,ip_address=172.16.100.0/24

[centos@handson9-openstack-single ~]$ exit

前回 演習 同様 編集

(28)

Nova

28

(29)

nova のプ セ とサービ

 起動 い nova 確認

o 複数起動 コ ・ CPU 環境 処理効率 上

 同時 い 起動 設定 worker 決定

[root@openstack-single ~(keystone_admin)]# ps -ef | grep nova

nova 1038 1 0 04:26 ? 00:00:46 /usr/bin/python2 /usr/bin/nova-scheduler nova 1042 1 0 04:26 ? 00:03:59 /usr/bin/python2 /usr/bin/nova-api

nova 1065 1 0 04:26 ? 00:00:12 /usr/bin/python2 /usr/bin/nova-novncproxy --web /usr/share/novnc/ nova 1070 1 0 04:26 ? 00:00:42 /usr/bin/python2 /usr/bin/nova-cert

nova 1078 1 0 04:26 ? 00:03:57 /usr/bin/python2 /usr/bin/nova-conductor nova 1092 1 0 04:26 ? 00:00:41 /usr/bin/python2 /usr/bin/nova-consoleauth nova 2757 1 0 04:26 ? 00:01:44 /usr/bin/python2 /usr/bin/nova-compute nova 3519 1078 0 04:27 ? 00:01:36 /usr/bin/python2 /usr/bin/nova-conductor nova 3520 1078 0 04:27 ? 00:01:38 /usr/bin/python2 /usr/bin/nova-conductor nova 4084 1042 0 04:27 ? 00:00:16 /usr/bin/python2 /usr/bin/nova-api nova 4085 1042 0 04:27 ? 00:00:13 /usr/bin/python2 /usr/bin/nova-api nova 4148 1042 0 04:27 ? 00:00:00 /usr/bin/python2 /usr/bin/nova-api nova 4149 1042 0 04:27 ? 00:00:00 /usr/bin/python2 /usr/bin/nova-api root 13797 13688 0 12:55 pts/0 00:00:00 grep --color=auto nova

qemu 32174 1 1 11:16 ? 00:01:24 /usr/libexec/qemu-kvm -name instance-00000008 -S -machine 省略 qemu 32346 1 1 11:16 ? 00:01:24 /usr/libexec/qemu-kvm -name instance-00000009 -S -machine 省略

[root@openstack-single ~(keystone_admin)]# systemctl | grep nova

openstack-nova-api.service loaded active running OpenStack Nova API Server openstack-nova-cert.service loaded active running OpenStack Nova Cert Server openstack-nova-compute.service loaded active running OpenStack Nova Compute Server openstack-nova-conductor.service loaded active running OpenStack Nova Conductor Server openstack-nova-consoleauth.service loaded active running OpenStack Nova VNC console auth Server

起動 い

確認

OS

録 い nova ー

確認

(30)

仮想 ンの起動状態

 nova 操作 libvirt/kvm 環境 い 確認

 virsh コ ン や nova 起動 仮想 ン 確認 可能

o 環境 起動 以下 情報 確認

30

[root@openstack-single ~(keystone_admin)]# virsh list --all

Id Name State

---

2 instance-00000017 running

3 instance-00000018 running

4 instance-00000019 running

[root@openstack-single ~(keystone_admin)]# ps -ef |grep qemu-kvm

qemu 6795 1 5 04:10 ? 00:13:44 /usr/libexec/qemu-kvm -name instance-00000017 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -cpu host -m 2048 -realtime mlock=off - smp 2,sockets=2,cores=1,threads=1 -uuid dc1e3695-db8a-449c-833f-7dc21af09529 -smbios type=1,manufacturer=Fedora Project,product=OpenStack Nova,version=2015.1.1-1.el7,serial=0af04d3c- 78a9-43ae-8f3c-c26602e374f2,uuid=dc1e3695-db8a-449c-833f-7dc21af09529 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/instance-

00000017.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-shutdown -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/nova/instances/dc1e3695-db8a-449c-833f-7dc21af09529/disk,if=none,id=drive-virtio-

disk0,format=qcow2,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=25,id=hostnet0,vhost=on,vhostfd=26 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=fa:16:3e:36:1a:f1,bus=pci.0,addr=0x3 -chardev file,id=charserial0,path=/var/lib/nova/instances/dc1e3695-db8a-449c-833f-

7dc21af09529/console.log -device isa-serial,chardev=charserial0,id=serial0 -chardev pty,id=charserial1 -device isa-serial,chardev=charserial1,id=serial1 -device usb-tablet,id=input0 - vnc 0.0.0.0:0 -k ja -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -msg timestamp=on

qemu 7081 1 5 04:10 ? 00:13:50 /usr/libexec/qemu-kvm -name instance-00000018 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -cpu host -m 2048 -realtime mlock=off - smp 2,sockets=2,cores=1,threads=1 -uuid 37e82cb6-badc-4ad3-8c31-d44f0db182cf -smbios type=1,manufacturer=Fedora Project,product=OpenStack Nova,version=2015.1.1-1.el7,serial=0af04d3c- 78a9-43ae-8f3c-c26602e374f2,uuid=37e82cb6-badc-4ad3-8c31-d44f0db182cf -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/instance-

00000018.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-shutdown -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/var/lib/nova/instances/37e82cb6-badc-4ad3-8c31-d44f0db182cf/disk,if=none,id=drive-virtio-

disk0,format=qcow2,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=25,id=hostnet0,vhost=on,vhostfd=27 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=fa:16:3e:77:7c:70,bus=pci.0,addr=0x3 -netdev tap,fd=28,id=hostnet1,vhost=on,vhostfd=29 -device virtio-net-

pci,netdev=hostnet1,id=net1,mac=fa:16:3e:8f:eb:a4,bus=pci.0,addr=0x4 -chardev file,id=charserial0,path=/var/lib/nova/instances/37e82cb6-badc-4ad3-8c31-d44f0db182cf/console.log -device isa-serial,chardev=charserial0,id=serial0 -chardev pty,id=charserial1 -device isa-serial,chardev=charserial1,id=serial1 -device usb-tablet,id=input0 -vnc 0.0.0.0:1 -k ja -vga cirrus - device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6 -msg timestamp=on

qemu 7441 1 6 04:11 ? 00:16:07 /usr/libexec/qemu-kvm -name instance-00000019 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -cpu host -m 2048 -realtime mlock=off - smp 2,sockets=2,cores=1,threads=1 -uuid e315087d-d258-4441-ae1e-8c39563d0880 -smbios type=1,manufacturer=Fedora Project,product=OpenStack Nova,version=2015.1.1-1.el7,serial=0af04d3c- 78a9-43ae-8f3c-c26602e374f2,uuid=e315087d-d258-4441-ae1e-8c39563d0880 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/instance-

00000019.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-shutdown -boot strict=on -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -drive file=/dev/disk/by-path/ip-192.168.100.10:3260-iscsi-iqn.2010-10.org.openstack:volume-c871554c-ad7e-4917-8945- c2e1725fa577-lun-0,if=none,id=drive-virtio-disk0,format=raw,serial=c871554c-ad7e-4917-8945-c2e1725fa577,cache=none -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x4,drive=drive- virtio-disk0,id=virtio-disk0,bootindex=1 -netdev tap,fd=25,id=hostnet0,vhost=on,vhostfd=28 -device virtio-net-pci,netdev=hostnet0,id=net0,mac=fa:16:3e:9d:c7:be,bus=pci.0,addr=0x3 - chardev file,id=charserial0,path=/var/lib/nova/instances/e315087d-d258-4441-ae1e-8c39563d0880/console.log -device isa-serial,chardev=charserial0,id=serial0 -chardev pty,id=charserial1 -device isa-serial,chardev=charserial1,id=serial1 -device usb-tablet,id=input0 -vnc 0.0.0.0:2 -k ja -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 -msg timestamp=on

libvirtd 経由 仮想

ン 起動 い 事 確認

起動 い 情報 確認

細 情報 確認

(31)

仮想 ンの定義情報

 定義 い 仮想 ン 実体 確認

 仮想 ン 実体 /var/lib/nova/instances 保存 い

[root@openstack-single instances(keystone_admin)]# cd /var/lib/nova/instances/

[root@openstack-single instances(keystone_admin)]# ls -alF

total 8

drwxr-xr-x. 2 nova nova 80 Nov 24 08:05 _base

-rw-r--r--. 1 nova nova 49 Nov 25 10:09 compute_nodes

drwxr-xr-x. 2 nova nova 69 Nov 25 04:10 37e82cb6-badc-4ad3-8c31-d44f0db182cf

drwxr-xr-x. 2 nova nova 69 Nov 25 04:10 dc1e3695-db8a-449c-833f-7dc21af09529

drwxr-xr-x. 2 nova nova 42 Nov 25 04:11 e315087d-d258-4441-ae1e-8c39563d0880

drwxr-xr-x. 2 nova nova 4096 Nov 24 08:05 locks

drwxr-xr-x. 2 nova nova 6 Nov 21 05:50 snapshots

[root@openstack-single instances(keystone_admin)]# nova list --fields name

+---+---+

| ID | Name |

+---+---+

| dc1e3695-db8a-449c-833f-7dc21af09529 | test-vm-1 |

| 37e82cb6-badc-4ad3-8c31-d44f0db182cf | test-vm-2 |

| e315087d-d258-4441-ae1e-8c39563d0880 | test-vm-3 |

+---+---+

nova 割 当 UUID

名前 作成

ン ン

実体情報 格納 い

(32)

仮想 ンの定義情報

 実際 仮想 ン 定義 い 確認

o libvirt.xml 仮想 ン 定義 保存

 名前 通 libvirt 用 xml

 仮想 ー ー 演習 virt-install や virt-manager 利用 仮想 ン 作成 い 同

仮想 ン 作成 い

32

[root@openstack-single instances(keystone_admin)]# ls -alF

total 12

drwxr-xr-x. 8 nova nova 4096 Nov 25 04:11 ./

drwxr-xr-x. 9 nova nova 103 Nov 20 12:57 ../

drwxr-xr-x. 2 nova nova 69 Nov 25 04:10 37e82cb6-badc-4ad3-8c31-d44f0db182cf/

drwxr-xr-x. 2 nova nova 80 Nov 24 08:05 _base/

-rw-r--r--. 1 nova nova 49 Nov 25 11:32 compute_nodes

drwxr-xr-x. 2 nova nova 69 Nov 25 04:10 dc1e3695-db8a-449c-833f-7dc21af09529/

drwxr-xr-x. 2 nova nova 42 Nov 25 04:11 e315087d-d258-4441-ae1e-8c39563d0880/

drwxr-xr-x. 2 nova nova 4096 Nov 24 08:05 locks/

drwxr-xr-x. 2 nova nova 6 Nov 21 05:50 snapshots/

[root@openstack-single instances(keystone_admin)]# cd dc1e3695-db8a-449c-833f-7dc21af09529/

[root@openstack-single dc1e3695-db8a-449c-833f-7dc21af09529(keystone_admin)]# ls -alF

total 148408

drwxr-xr-x. 2 nova nova 69 Nov 25 04:10 ./

drwxr-xr-x. 8 nova nova 4096 Nov 25 04:11 ../

-rw-rw----. 1 qemu qemu 40475 Nov 25 04:19 console.log

-rw-r--r--. 1 qemu qemu 151912448 Nov 25 11:29 disk

-rw-r--r--. 1 nova nova 79 Nov 25 04:09 disk.info

-rw-r--r--. 1 nova nova 2623 Nov 25 04:10 libvirt.xml

[root@openstack-single dc1e3695-db8a-449c-833f-7dc21af09529(keystone_admin)]# cat libvirt.xml

出力 次ペー へ

中身 確認

test-vm-1 定義 確認

nova boot UUID

名前 移

(33)

libvirt.xml

<domain type="kvm">

<uuid>dc1e3695-db8a-449c-833f-7dc21af09529</uuid>

<name>instance-00000017</name>

<memory>2097152</memory>

<vcpu>2</vcpu>

<metadata>

<nova:instance xmlns:nova="http://openstack.org/xmlns/libvirt/nova/1.0">

<nova:package version="2015.1.1-1.el7"/>

<nova:name>test-vm-1</nova:name>

<nova:creationTime>2015-11-25 04:10:24</nova:creationTime>

<nova:flavor name="my.standard">

<nova:memory>2048</nova:memory>

<nova:disk>10</nova:disk>

<nova:swap>0</nova:swap>

<nova:ephemeral>0</nova:ephemeral>

<nova:vcpus>2</nova:vcpus>

</nova:flavor>

<nova:owner>

<nova:user uuid="c473d119c2ac41a88a7a88762caf9696">admin</nova:user>

<nova:project uuid="75e4fcce5a0c4ee88a4ae35eebc5e24e">admin</nova:project>

</nova:owner>

<nova:root type="image" uuid="95dcd698-bbba-48c8-a117-e14434eefed8"/>

</nova:instance>

</metadata>

<sysinfo type="smbios">

<system>

<entry name="manufacturer">Fedora Project</entry>

<entry name="product">OpenStack Nova</entry>

<entry name="version">2015.1.1-1.el7</entry>

<entry name="serial">0af04d3c-78a9-43ae-8f3c-c26602e374f2</entry>

<entry name="uuid">dc1e3695-db8a-449c-833f-7dc21af09529</entry>

</system>

</sysinfo>

<os>

<type>hvm</type>

<boot dev="hd"/>

<smbios mode="sysinfo"/>

</os>

<features>

<acpi/>

<apic/>

</features>

<cputune>

<shares>2048</shares>

</cputune>

<clock offset="utc">

( )

<cpu mode="host-passthrough" match="exact">

<topology sockets="2" cores="1" threads="1"/>

</cpu>

<devices>

<disk type="file" device="disk">

<driver name="qemu" type="qcow2" cache="none"/>

<source file="/var/lib/nova/instances/dc1e3695-db8a-449c-833f-7dc21af09529/disk"/>

<target bus="virtio" dev="vda"/>

</disk>

<interface type="bridge">

<mac address="fa:16:3e:36:1a:f1"/>

<model type="virtio"/>

<source bridge="qbra27766f4-0c"/>

<target dev="tapa27766f4-0c"/>

</interface>

<serial type="file">

<source path="/var/lib/nova/instances/dc1e3695-db8a-449c-833f-7dc21af09529/console.log"/>

</serial>

<serial type="pty"/>

<input type="tablet" bus="usb"/>

<graphics type="vnc" autoport="yes" keymap="ja" listen="0.0.0.0"/>

<video>

<model type="cirrus"/>

</video>

<memballoon model="virtio">

<stats period="10"/>

</memballoon>

</devices>

</domain>

情報 記載 い

次項 確認

他 ワー やコンソー

VNC 等 重要 情報 確認

 仮想 ー ー 構成 様々 情報 記述 い

Nova 自動生成 い

(34)

ー フ の実体

 ン ン 実体 同 UUID名 配置 disk

o /var/lib/nova/instances/_base 格納

o _base 保存 glance 取得 実体

o nova 起動 う 管理

量 節約や 再 ン ー 遅延 無 う 設計 い

 正確 同 ー 同 ー ー 起動

34

[root@openstack-single dc1e3695-db8a-449c-833f-7dc21af09529(keystone_admin)]# ls -alF

total 148408

drwxr-xr-x. 2 nova nova 69 Nov 25 04:10 ./

drwxr-xr-x. 8 nova nova 4096 Nov 25 04:11 ../

-rw-rw----. 1 qemu qemu 40475 Nov 25 04:19 console.log

-rw-r--r--. 1 qemu qemu 151912448 Nov 25 11:29 disk

-rw-r--r--. 1 nova nova 79 Nov 25 04:09 disk.info

-rw-r--r--. 1 nova nova 2623 Nov 25 04:10 libvirt.xml

[root@openstack-single dc1e3695-db8a-449c-833f-7dc21af09529(keystone_admin)]# qemu-img info disk

image: disk

file format: qcow2

virtual size: 10G (10737418240 bytes)

disk size: 145M

cluster_size: 65536

backing file: /var/lib/nova/instances/_base/2a1810f919f9dd0532222c51101f4209ea072952

Format specific information:

compat: 1.1

lazy refcounts: false

内容 確認

別 ー ー

あ 確認

(35)

ー フ の実体

 他 仮想 ン 情報 確認

o test-vm-1,2 起動 disk キン

持 い

o test-vm-3 情報 出力 boot from

volume 起動

[root@openstack-single instances(keystone_admin)]# cd /var/lib/nova/instances/ [root@openstack-single instances(keystone_admin)]# nova list --fields name +---+---+

| ID | Name | +---+---+

| dc1e3695-db8a-449c-833f-7dc21af09529 | test-vm-1 |

| 37e82cb6-badc-4ad3-8c31-d44f0db182cf | test-vm-2 |

| e315087d-d258-4441-ae1e-8c39563d0880 | test-vm-3 | +---+---+

[root@openstack-single instances(keystone_admin)]# grep -R "source file" */*.xml

37e82cb6-badc-4ad3-8c31-d44f0db182cf/libvirt.xml: <source file="/var/lib/nova/instances/37e82cb6-badc-4ad3-8c31-d44f0db182cf/disk"/> dc1e3695-db8a-449c-833f-7dc21af09529/libvirt.xml: <source file="/var/lib/nova/instances/dc1e3695-db8a-449c-833f-7dc21af09529/disk"/> [root@openstack-single instances(keystone_admin)]# qemu-img info /var/lib/nova/instances/37e82cb6-badc-4ad3-8c31-d44f0db182cf/disk image: /var/lib/nova/instances/37e82cb6-badc-4ad3-8c31-d44f0db182cf/disk

file format: qcow2

virtual size: 10G (10737418240 bytes) disk size: 145M

cluster_size: 65536

backing file: /var/lib/nova/instances/_base/2a1810f919f9dd0532222c51101f4209ea072952 Format specific information:

compat: 1.1

lazy refcounts: false

[root@openstack-single instances(keystone_admin)]# qemu-img info /var/lib/nova/instances/dc1e3695-db8a-449c-833f-7dc21af09529/disk image: /var/lib/nova/instances/dc1e3695-db8a-449c-833f-7dc21af09529/disk

file format: qcow2

virtual size: 10G (10737418240 bytes) disk size: 145M

同 キン

持 い

(36)

Boot From Volume ン タン の定義

 test-vm-3 cinder ー 起動 い 実体 所持

o libvirt 定義 cinder 提供 今回 iSCSI 接続

確認

o 接続 後 演習 確認

36

[root@openstack-single instances(keystone_admin)]# cd /var/lib/nova/instances/

[root@openstack-single instances(keystone_admin)]# nova list --fields name

+---+---+

| ID | Name |

+---+---+

| dc1e3695-db8a-449c-833f-7dc21af09529 | test-vm-1 |

| 37e82cb6-badc-4ad3-8c31-d44f0db182cf | test-vm-2 |

| e315087d-d258-4441-ae1e-8c39563d0880 | test-vm-3 |

+---+---+

[root@openstack-single instances(keystone_admin)]# ls -alF e315087d-d258-4441-ae1e-8c39563d0880

total 48

drwxr-xr-x. 2 nova nova 42 Nov 25 04:11 ./

drwxr-xr-x. 8 nova nova 4096 Nov 25 04:11 ../

-rw-rw----. 1 nova qemu 40618 Nov 25 04:21 console.log

-rw-r--r--. 1 nova nova 2662 Nov 25 04:11 libvirt.xml

[root@openstack-single instances(keystone_admin)]# less e315087d-d258-4441-ae1e-8c39563d0880/libvirt.xml

抜粋

<disk type="block" device="disk">

<driver name="qemu" type="raw" cache="none"/>

<source dev="/dev/disk/by-path/ip-192.168.100.10:3260-iscsi-iqn.2010-10.org.openstack:volume-c871554c-ad7e-4917-8945-c2e1725fa577- lun-0"/>

<target bus="virtio" dev="vda"/>

<serial>c871554c-ad7e-4917-8945-c2e1725fa577</serial>

</disk> 抜粋

test-vm-1 定義 比較

<disk type="file" device="disk">

<driver name="qemu" type="qcow2" cache="none"/>

<source file="/var/lib/nova/instances/dc1e3695-db8a-449c-833f-7dc21af09529/disk"/>

<target bus="virtio" dev="vda"/>

</disk>

test-vm-3 disk

所持 い い事 確認

接続 iscsi

直接指定 い

(37)

nova-compute プ セ と仮想

 nova-compute 起動 各仮想 ン 独立 い

o nova-compute 停止 仮想 ン 影響 受

o 新 い仮想 ン 作成や 削除 ー等 発生

 管理者 virshコ ン やkillコ ン 利用 nova 経由 仮想

ン 操作 可能

o 緊急時や 行う際 手法 原則的 nova 経由 操作

行う必要 あ

o nova 実際 状態 異 nova 動作

(38)

nova の構成 ータベー

 nova 全情報 ー ー 保存 い

o 停止 状態取得 含 一切 操作 行え

o 前述 既 動い い 機能 停止 あ

 以下 手順 ー 一部 確認

38

[root@openstack-single ~ keystone_admin ]# mysql -uroot nova

MariaDB [nova]> show tables;

+---+

| Tables_in_nova |

+---+

| agent_builds |

| aggregate_hosts |

| aggregate_metadata |

| aggregates |

| block_device_mapping |

| bw_usage_cache |

| cells |

| certificates |

| compute_nodes |

| console_pools |

| consoles |

| dns_domains |

| fixed_ips |

省略

MariaDB [nova]> select * from services;

MariaDB [nova]> select * from compute_nodes;

MariaDB [nova]> select uuid,created_at,hostname,deleted from instances;

nova

所持 ー 一覧 確

い ー ー

確認 う

(39)

nova の ータベー

 nova ー ー ー 削除 い設計 い

 不要 ー 削除 ー 残 続

 長期 わ 運用 場合 不要 ー 定期的 削除 必

要 あ

MariaDB [nova]> select uuid,created_at,hostname,deleted from instances;

+---+---+---+---+

| uuid | created_at | hostname | deleted |

+---+---+---+---+

| 53391918-e4b1-40e9-ad1d-75b7c408b74b | 2015-11-20 14:50:42 | test-vm-1 | 1 |

| 02f782b3-975a-4314-927b-a446900210ad | 2015-11-21 04:33:57 | test-vm-1 | 2 |

| cafad1d4-99e7-4f64-b417-c06bdd03197c | 2015-11-21 04:34:03 | test-vm-2 | 3 |

| 3b181581-0c32-4a72-baf0-e94755d33a4d | 2015-11-21 04:35:13 | test-vm-3 | 4 |

| a216d8b0-bfa0-41ce-8389-e63b4be0fd5c | 2015-11-21 04:41:51 | test-vm-4 | 5 |

| 6d97c09b-bc0c-421b-b36f-4bb652d1b282 | 2015-11-21 05:48:17 | test-vm-3 | 6 |

| 95715a93-4926-443c-81d7-f43f0d61918e | 2015-11-21 05:51:26 | test-vm-4 | 7 |

| 3c23815e-a2f5-4751-9025-d44e488a8489 | 2015-11-22 09:31:34 | test-vm-1 | 8 |

| 8d975aa7-8fee-44c4-a9b3-2b2e019fd0c0 | 2015-11-22 09:31:44 | test-vm-2 | 9 |

| ac0770f2-ee80-4e1c-a75b-a32b9bc9d88e | 2015-11-22 11:19:28 | test-vm-1 | 10 |

| 37d0f512-a2ad-45ca-ba28-f262af9fa4e0 | 2015-11-22 11:33:39 | vol-vm-1 | 11 |

| f576e4ae-8d7f-4f56-a1b1-ce6803295f46 | 2015-11-22 11:40:31 | vol-vm-2 | 12 |

| 6093309d-d949-44ad-8bd8-0184441fa23f | 2015-11-24 08:05:32 | test-vm-1 | 13 |

| 9fa056d2-ba28-468c-9ff1-4e67e9f7e4e9 | 2015-11-24 08:05:39 | test-vm-2 | 14 |

| 46392d9a-9416-49a5-966e-50011d3dd5d1 | 2015-11-24 17:19:20 | test-vm-1 | 15 |

| 74e1d4bb-2193-4dcc-9d01-cd473104376c | 2015-11-24 17:19:23 | test-vm-2 | 16 |

| 2a16ff12-3e11-4343-b101-baf1a6351136 | 2015-11-24 17:35:41 | test-vm-3 | 17 |

| fc1839bc-324d-4cef-91c6-007fc7cfa152 | 2015-11-24 18:11:23 | test-vm-1 | 18 |

| 9323f787-9373-4d69-bb66-c706acfd5d7d | 2015-11-24 18:12:11 | test-vm-2 | 19 |

| 2b624361-5b4f-4e13-baa6-6fbf0f8c7512 | 2015-11-24 18:12:39 | test-vm-3 | 20 |

| 374817b0-3e95-4348-8258-038ac94ebcf7 | 2015-11-25 03:50:39 | test-vm-1 | 21 |

| ab8449bf-1a70-416e-ac86-240610c43571 | 2015-11-25 03:50:50 | test-vm-2 | 22 |

| dc1e3695-db8a-449c-833f-7dc21af09529 | 2015-11-25 04:09:49 | test-vm-1 | 0 |

既 削除 ン ン

情報 確認

(40)

Cinder

40

(41)

Cinder プ セ とサービ

 起動 い cinder 確認

 nova 比 コンソー 機能等 少 い 数 少 い

 既 2 ー 1 作成 い

o 1 作成

[root@openstack-single ~ keystone_admin ]# ps -e |grep cinder

0 ? 00:0 : cinder-api

0 ? 00:0 : cinder-volume 0 ? 00:00: cinder-schedule

? 00:00:0 cinder-api ? 00:00:0 cinder-api 0 ? 00:00:0 cinder-api ? 00:00: cinder-api ? 00:00: cinder-volume

[root@openstack-single ~ keystone_admin ]# systemctl |grep cinder

openstack-cinder-api.service loaded active running OpenStack Cinder API Server openstack-cinder-scheduler.service loaded active running OpenStack Cinder Scheduler Server openstack-cinder-volume.service loaded active running OpenStack Cinder Volume Server openstack-losetup.service loaded active exited Setup cinder-volume loop device

[root@openstack-single ~ keystone_admin ]# cinder list

+---+---+---+---+---+---+---+

| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to | +---+---+---+---+---+---+---+

| b6a1872e-c626-4747-b95f-246d7ff1dd15 | available | copy-snap-vol | 0 | - | true | |

| c871554c-ad7e-4917-8945-c2e1725fa577 | in-use | boot-vol | 0 | - | true | e315087d-d258-4441-ae1e-8c39563d0880 | +---+---+---+---+---+---+---+

[root@openstack-single ~ keystone_admin ]# cinder snapshot-list

(42)

LVM 状態の確認

 今回 cinder LVM(iSCSI) 構成 い

LVM 状態 確認

o 論理 作成 確認

42

[root@openstack-single ~ keystone_admin ]# pvs

PV VG Fmt Attr PSize PFree

/dev/loop0 cinder-volumes lvm2 a-- 30.90g 920.00m

[root@openstack-single ~ keystone_admin ]# vgs

VG #PV #LV #SN Attr VSize VFree

cinder-volumes wz--n- 30.90g 920.00m

[root@openstack-single ~ keystone_admin ]# lvs

LV VG Attr LSize Pool Origin Data% _snapshot-bf96668c-3a8e-4e86-86fd-29fbf22076c1 cinder-volumes swi-a-s--- 10.00g volume-c871554c-ad7e-4917-8945-c2e1725fa577 0.26 volume-b6a1872e-c626-4747-b95f-246d7ff1dd15 cinder-volumes -wi-a--- 10.00g

volume-c871554c-ad7e-4917-8945-c2e1725fa577 cinder-volumes owi-aos--- 10.00g

packstack 設定 指定

領域 作成 い

例 ー

作成 ー

確認

ATTR 部分 読 取 事 ATTR

次項 参照 い

(43)

補足:LVM Attributes (man lvsよ )

# Attributes Descriptions

1 Volume type (C)ache, (m)irrored, (M)irrored without initial sync, (o)rigin, (O)rigin with merging snapshot, (r)aid, (R)aid without initial sync, (s)napshot, merging (S)napshot, (p)vmove,(v)irtual, mirror or raid (i)mage, mirror or raid (I)mage out-of-sync, mirror (l)og device, under (c)onversion, thin (V)olume, (t)hin pool, (T)hin pool data, raid or pool m(e)tadata or pool metadata spare.

2 Permissions (w)riteable, (r)ead-only, (R)ead-only activation of non-read-only volume

3 Allocation policy (a)nywhere, (c)ontiguous, (i)nherited, c(l)ing, (n)ormal This is capitalised if the volume is currently locked against allocation changes, for example during pvmove(8).

4 fixed (m)inor

5 State (a)ctive, (s)uspended, (I)nvalid snapshot, invalid (S)uspended snapshot, snapshot (m)erge failed, suspended snapshot (M)erge failed, mapped (d)evice present without tables, mapped device present with (i)nactive table, (X) unknown

6 device (o)pen, (X) unknown

7 Target type (C)ache, (m)irror, (r)aid, (s)napshot, (t)hin, (u)nknown, (v)irtual. This groups logical volumes related to the same kernel target together. So, for example, mirror images, mirror logs as well as mirrors themselves appear as (m) if they use the original device-mapper mirror kernel driver; whereas the raid equivalents using the md raid kernel driver all appear as (r). Snapshots using the original device-mapper driver appear as (s); whereas snapshots of thin volumes using the new thin provisioning driver appear as (t).

8 Newly-allocated data blocks are overwritten with blocks of (z)eroes before use.

-

9 Volume Health (p)artial, (r)efresh needed, (m)ismatches exist, (w)ritemostly, (X) unknown. (p)artial signifies that one or more of the Physical Volumes this Logical Volume uses is missing from the system. (r)efresh signifies that one or more of the Physical Volumes this RAID Logical Volume uses had suffered a write error. The write error could be due to a temporary failure of that Physical Volume or an indication that it is failing. The device should be refreshed or replaced. (m)ismatches signifies that the RAID logical volume has portions of the array that are not coherent. Inconsistencies are detected by initiating a "check" on a RAID logical volume. (The scrubbing operations, "check" and "repair", can be performed on a RAID logical volume via the

'lvchange' command.) (w)ritemostly signifies the devices in a RAID 1 logical volume that have been marked write-mostly.

(44)

補足:LVM & Device Mapper

 Linux LVM Device Mapper(DM) 実現 い

 DM 複数 別 見 仕組

Linux 重要 機能

 ン 追う 間 確認 可能

44

[root@openstack-single ~ keystone_admin ]# dmsetup table

cinder --volumes-volume--b6a1872e--c626--4747--b95f--246d7ff1dd15: 0 20971520 linear :0 0

cinder --volumes-_snapshot--bf96668c--3a8e--4e86--86fd--29fbf22076c1-cow: 0 20971520 linear :0 0

cinder --volumes-_snapshot--bf96668c--3a8e--4e86--86fd--29fbf22076c1: 0 20971520 snapshot : : P

cinder --volumes-volume--c871554c--ad7e--4917--8945--c2e1725fa577-real: 0 20971520 linear :0 0

cinder--volumes-volume--c871554c--ad7e--4917--8945--c2e1725fa577: 0 20971520 snapshot-origin :

[root@openstack-single ~ keystone_admin ]# dmsetup ls

cinder --volumes-volume--b6a1872e--c626--4747--b95f--246d7ff1dd15 (252:4)

cinder--volumes-_snapshot--bf96668c--3a8e--4e86--86fd--29fbf22076c1-cow (252:2)

cinder --volumes-_snapshot--bf96668c--3a8e--4e86--86fd--29fbf22076c1 (252:3)

cinder--volumes-volume--c871554c--ad7e--4917--8945--c2e1725fa577-real (252:1)

cinder --volumes-volume--c871554c--ad7e--4917--8945--c2e1725fa577 (252:0)

[root@openstack-single ~ keystone_admin ]# dmsetup ls --tree

cinder--volumes-volume--b6a1872e--c626--4747--b95f--246d7ff1dd15 (252:4)

└─ :0

cinder--volumes-_snapshot--bf96668c--3a8e--4e86--86fd--29fbf22076c1 (252:3)

├─cinder--volumes-_snapshot--bf96668c--3a8e--4e86--86fd--29fbf22076c1-cow (252:2)

│ └─ :0

└─cinder--volumes-volume--c871554c--ad7e--4917--8945--c2e1725fa577-real (252:1)

└─ :0

cinder --volumes-volume--c871554c--ad7e--4917--8945--c2e1725fa577 (252:0)

└─cinder--volumes-volume--c871554c--ad7e--4917--8945--c2e1725fa577-real (252:1)

└─ :0

(45)

cinder ュー とLVMの対応

 cinder 生成 ー や 付与 UUID LVM

側 命名 反映

 cinder 作成 ー 実体 対応 LVM

[root@openstack-single ~(keystone_admin)]# cinder list

+---+---+---+---+---+---+---+

| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to | +---+---+---+---+---+---+---+

| b6a1872e-c626-4747-b95f-246d7ff1dd15 | available | copy-snap-vol | 10 | - | true | |

| c871554c-ad7e-4917-8945-c2e1725fa577 | in-use | boot-vol | 10 | - | true | e315087d-d258-4441-ae1e-8c39563d0880 | +---+---+---+---+---+---+---+

[root@openstack-single ~(keystone_admin)]# cinder snapshot-list

+---+---+---+---+---+

| ID | Volume ID | Status | Display Name | Size | +---+---+---+---+---+

| bf96668c-3a8e-4e86-86fd-29fbf22076c1 | c871554c-ad7e-4917-8945-c2e1725fa577 | available | boot-vol-snap | 10 | +---+---+---+---+---+

[root@openstack-single ~(keystone_admin)]# lvs

LV VG Attr LSize Pool Origin Data% _snapshot-bf96668c-3a8e-4e86-86fd-29fbf22076c1 cinder-volumes swi-a-s--- 10.00g volume-c871554c-ad7e-4917-8945-c2e1725fa577 0.26 volume-b6a1872e-c626-4747-b95f-246d7ff1dd15 cinder-volumes -wi-a--- 10.00g

volume-c871554c-ad7e-4917-8945-c2e1725fa577 cinder-volumes owi-aos--- 10.00g

cinder UUIDni 対応 論理

作成 い

(46)

cinder ュー と ンタン の接続

 nova 項目 確認 い cindernova ン ン 接続

iSCSI 行わ

o LVM & iSCSI 使 場合 接続方式

 接続 う 実現 い 確認

46

[root@openstack-single ~(keystone_admin)]# targetcli ls

o- / ... [...] o- backstores ... [...]

| o- block ... [Storage Objects: 1]

| | o- iqn.2010-10.org.openstack:volume-c871554c-ad7e-4917-8945-c2e1725fa577 [/dev/cinder-volumes/volume-c871554c-ad7e-4917-8945-c2e1725fa577 (10.0GiB) write-thru activated]

| o- fileio ... [Storage Objects: 0]

| o- pscsi ... [Storage Objects: 0]

| o- ramdisk ... [Storage Objects: 0] o- iscsi ... [Targets: 1]

| o- iqn.2010-10.org.openstack:volume-c871554c-ad7e-4917-8945-c2e1725fa577 ... [TPGs: 1]

| o- tpg1 ... [no-gen-acls, auth per-acl]

| o- acls ... [ACLs: 1]

| | o- iqn.1994-05.com.redhat:2bf21e3cca8c ... [1-way auth, Mapped LUNs: 1]

| | o- mapped_lun0 ... [lun0 block/iqn.2010-10.org.openstack:volume-c871554c-ad7e-4917-8945-c2e1725fa577 (rw)]

| o- luns ... [LUNs: 1]

| | o- lun0 [block/iqn.2010-10.org.openstack:volume-c871554c-ad7e-4917-8945-c2e1725fa577 (/dev/cinder-volumes/volume-c871554c-ad7e-4917-8945-c2e1725fa577)]

| o- portals ... [Portals: 1]

| o- 192.168.199.100:3260 ... [OK] o- loopback ... [Targets: 0]

[root@openstack-single ~(keystone_admin)]# iscsiadm --mode node

192.168.199.100:3260,-1 iqn.2010-10.org.openstack:volume-c871554c-ad7e-4917-8945-c2e1725fa577

現在 1 ー 接続 い 状

態 公開 い ー 1

(47)

cinder ュー と ンタン の接続

 未接続 ー ン ン 接続 状態 変化 確認

o 接続 iSCSI 状態 変化

[root@openstack-single ~(keystone_admin)]# cinder list

+---+---+---+---+---+---+---+

| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to | +---+---+---+---+---+---+---+

| b6a1872e-c626-4747-b95f-246d7ff1dd15 | available | copy-snap-vol | 10 | - | true | |

| c871554c-ad7e-4917-8945-c2e1725fa577 | in-use | boot-vol | 10 | - | true | e315087d-d258-4441-ae1e-8c39563d0880 | +---+---+---+---+---+---+---+

[root@openstack-single ~(keystone_admin)]# nova volume-attach test-vm-1 b6a1872e-c626-4747-b95f-246d7ff1dd15

[root@openstack-single ~(keystone_admin)]# targetcli ls

o- / ... [...] o- backstores ... [...]

| o- block ... [Storage Objects: 2]

| | o- iqn.2010-10.org.openstack:volume-b6a1872e-c626-4747-b95f-246d7ff1dd15 [/dev/cinder-volumes/volume-b6a1872e-c626-4747-b95f-246d7ff1dd15 (10.0GiB) write-thru activated]

| | o- iqn.2010-10.org.openstack:volume-c871554c-ad7e-4917-8945-c2e1725fa577 [/dev/cinder-volumes/volume-c871554c-ad7e-4917-8945-c2e1725fa577 (10.0GiB) write-thru activated]

| o- fileio ... [Storage Objects: 0]

| o- pscsi ... [Storage Objects: 0]

| o- ramdisk ... [Storage Objects: 0] o- iscsi ... [Targets: 2]

| o- iqn.2010-10.org.openstack:volume-b6a1872e-c626-4747-b95f-246d7ff1dd15 ... [TPGs: 1]

| | o- tpg1 ... [no-gen-acls, auth per-acl]

| | o- acls ... [ACLs: 1]

| | | o- iqn.1994-05.com.redhat:2bf21e3cca8c ... [1-way auth, Mapped LUNs: 1]

| | | o- mapped_lun0 ... [lun0 block/iqn.2010-10.org.openstack:volume-b6a1872e-c626-4747-b95f-246d7ff1dd15 (rw)]

| | o- luns ... [LUNs: 1]

| | | o- lun0 [block/iqn.2010-10.org.openstack:volume-b6a1872e-c626-4747-b95f-246d7ff1dd15 (/dev/cinder-volumes/volume-b6a1872e-c626-4747-b95f-246d7ff1dd15)]

| | o- portals ... [Portals: 1]

| | o- 192.168.199.100:3260 ... [OK]

| o- iqn.2010-10.org.openstack:volume-c871554c-ad7e-4917-8945-c2e1725fa577 ... [TPGs: 1]

| o- tpg1 ... [no-gen-acls, auth per-acl]

| o- acls ... [ACLs: 1]

| | o- iqn.1994-05.com.redhat:2bf21e3cca8c ... [1-way auth, Mapped LUNs: 1]

| | o- mapped_lun0 ... [lun0 block/iqn.2010-10.org.openstack:volume-c871554c-ad7e-4917-8945-c2e1725fa577 (rw)]

| o- luns ... [LUNs: 1]

| | o- lun0 [block/iqn.2010-10.org.openstack:volume-c871554c-ad7e-4917-8945-c2e1725fa577 (/dev/cinder-volumes/volume-c871554c-ad7e-4917-8945-c2e1725fa577)]

| o- portals ... [Portals: 1]

| o- 192.168.199.100:3260 ... [OK] o- loopback ... [Targets: 0]

[root@openstack-single ~(keystone_admin)]# iscsiadm --mode node

test-vm-1

copy-snap-vol

接続

新 い設定 追加

確認

(48)

Neutron

48

(49)

Neutron プ セ とサービ

 起動 い Neutron 確認

o 非常 多数 起動 確認

[root@openstack-single ~(keystone_admin)]# ps -e | grep neutron

1045 ? 00:00:18 neutron-metadat

1057 ? 00:00:21 neutron-lbaas-a

1066 ? 00:00:36 neutron-meterin

1118 ? 00:01:14 neutron-server

2756 ? 00:00:38 neutron-l3-agen

2758 ? 00:00:37 neutron-dhcp-ag

2774 ? 00:02:39 neutron-openvsw

2887 ? 00:00:03 neutron-metadat

2888 ? 00:00:03 neutron-metadat

3288 ? 00:00:18 neutron-rootwra

3495 ? 00:00:00 neutron-rootwra

4013 ? 00:00:39 neutron-server

4014 ? 00:00:18 neutron-server

4015 ? 00:01:26 neutron-server

4016 ? 00:01:19 neutron-server

4017 ? 00:00:25 neutron-server

15792 ? 00:00:00 neutron-rootwra

15885 ? 00:00:00 neutron-ns-meta

16046 ? 00:00:00 neutron-rootwra

[root@openstack-single ~(keystone_admin)]# systemctl | grep neutron

neutron-dhcp-agent.service loaded active running OpenStack Neutron DHCP Agent

neutron-l3-agent.service loaded active running OpenStack Neutron Layer 3 Agent

neutron-lbaas-agent.service loaded active running OpenStack Neutron Load Balancing as a Service Agent

neutron-metadata-agent.service loaded active running OpenStack Neutron Metadata Agent

(50)

Neutron が構成す ネッ ワー の構成図

 Neutron 構成 ワー 複雑 状態 把握 困難

 い ー 使 現状 ワー 状態 可視化

 plotnetcfg, graphviz 利用

50

[root@handson9-openstack-single ~(keystone_admin)]# plotnetcfg > netmap.dot

[root@handson9-openstack-single ~(keystone_admin)]# dot -Tpng netmap.dot > netmap.png

[root@handson9-openstack-single ~(keystone_admin)]# cp netmap.png /var/www/html/

Note 以降 図 見 進 い

現在設定 い ワー 情報

収集

収集 情報 図 変換

生成 画像

httpd 配下 コ ー

自分 端末

http://xxx.xxx.xxx.xxx/netmap.png

xxx 部分 openstack-single 割 当 い Floating IP

(51)

Neutron が構成す ネッ ワー の構成図

 演習 解説上 標準 描画 扱い い 見や 編集 以下 図 利用

(52)

 仮想 ワー 実体 Linux ワー 機能 組合 構成

o Linux 各種 ワー 操作コ ン 利用 状況 確認や設定 変更 行

う事 可能

o 以下 コ ン 実行 情報 確認 ワー 図 見比

 時 ワー 図 存在 全 ン ー ー 確認

o ワー 隔離

52

[root@openstack-single ~]# ip link

[root@openstack-single ~]# ip addr

[root@openstack-single ~]# brctl show

[root@openstack-single ~]# ovs-vsctl show

Linux 認識 ン ー

ー 一覧 表示

Linux 構成

一覧 表示

Linux 構成 OVS 構成 表

(53)

隔離さ た ンターフ ー

 OVS Linux側 ン ー 差異 確認

 差異 Network Namespace機能 OS 上 ワー 環境 隔離

い 事 原因 発生 い

[root@openstack-single ~]# ovs-vsctl show | grep qr-

Port "qr-e471c6b6-4f"

Interface "qr-e471c6b6-4f"

[root@openstack-single ~]# ip addr | grep qr-

OVS 上 構成

Linux 認識 い い

(54)

Network Namespace 内の確認

 隔離 ワー 環境 確認

o 演習環境 5 Namespace 存在 確認

54

[root@openstack-single ~]# ip netns | sort qdhcp-0386bd97-1f81-490b-883f-2412502ec979 qdhcp-3ecdf516-e588-439d-9185-55b1b1eb7c8c qdhcp-6699b802-2038-432a-a453-60f7e9bf29ad qrouter-80e309a5-7ae1-4cdb-b4ec-a9f3a9234b24 qrouter-8d7b1023-0c4c-4546-9f38-3bdcc0432aad

[root@openstack-single ~]# ip netns exec qrouter-80e309a5-7ae1-4cdb-b4ec-a9f3a9234b24 ip addr |grep qr- 12: qr-e471c6b6-4f: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN

inet 10.20.20.254/24 brd 10.20.20.255 scope global qr-e471c6b6-4f

[root@openstack-single ~]# ovs-vsctl show |grep qr- Port "qr-e471c6b6-4f"

Interface "qr-e471c6b6-4f"

Namespace 確認

Namespace コ ン 実行

先程 確認 ン ー

ー 確認

Note 5 Namespace qrouter-, qdhcp- 付与

作成 ー ン 付与 決 い

qrouter- ・・・l3-agent 作 Namespace

qdhcp- ・・・dhcp-agent 作 Namespace

参照

関連したドキュメント

Finally, we give an example to show how the generalized zeta function can be applied to graphs to distinguish non-isomorphic graphs with the same Ihara-Selberg zeta

This paper derives a priori error estimates for a special finite element discretization based on component mode synthesis.. The a priori error bounds state the explicit dependency

[56] , Block generalized locally Toeplitz sequences: topological construction, spectral distribution results, and star-algebra structure, in Structured Matrices in Numerical

In section 3 all mathematical notations are stated and global in time existence results are established in the two following cases: the confined case with sharp-diffuse

Keywords: continuous time random walk, Brownian motion, collision time, skew Young tableaux, tandem queue.. AMS 2000 Subject Classification: Primary:

This article concerns the behaviour of solutions to a coupled sys- tem of Schr¨ odinger equations that has applications in many physical problems, especially in nonlinear optics..

Maria Cecilia Zanardi, São Paulo State University (UNESP), Guaratinguetá, 12516-410 São Paulo,

This paper gives a decomposition of the characteristic polynomial of the adjacency matrix of the tree T (d, k, r) , obtained by attaching copies of B(d, k) to the vertices of