8. OpenSackを採用したパブリッククラウドサービスのご紹介
Engineering SIDE
OpenStackのシステム構成; OpenStackを選択する理由
Multiple Flat and Multiple Private Network in Overlay
Physical Router
gw: 10.0.0.1
Shared Network
10.0.0.0/24
Tenant A
vm 1
10.0.0.2
172.21.0.2
gw: 10.0.2.1
Shared Network
10.0.2.0/24
Tenant B
vm 2
10.0.0.4
172.21.0.4
Tenant C
vm 1
10.0.2.5
Tenant B
vm 1
10.0.2.3
172.21.0.3
Tenant A
vm 2
10.0.2.6
172.21.0.6
Tenant B Private Network
172.21.0.0/24
Tenant A Private Network
172.21.0.0/24
overlay tunnel
8
12. OpenSackを採用したパブリッククラウドサービスのご紹介
Engineering SIDE
OpenStack Diablo: お名前.com VPS KVM ネットワーク
l3-agent
Internet
は使わずHWまたはアプライア
ンスのL3を使用
コンパネ系
L3 SW
L3 SW
サービス系
顧客global IPネットワーク
db
会員/課金 DB
API系global IPネットワーク
nova Compute
nova Compute
nova Compute
nova Compute
nova Compute
vm
nova Compute
nova Compute
nova Compute
nova Compute
nova Compute
RAID 10 local disk
API / Manage
コンパネweb (.Net)
API / Manage
mysql
API
管理系
Manage Hosts
Manage Hosts
vm
vm vm
vm
sftp
sftp
RAID 10 local disk
vm
console
console
vm
mq
ldap
vm
console
dhcp
vm
console
vnc
vm
API / Manage
mysql
nova DB
keystone DB
API/nova Manage
Keystone
Glance
glance
image
vm
mq
mq
db
Manageネットワーク (API, DB, mq, Storage)
Storage
Storage
ISO storage
(NFS)
12
13. OpenSackを採用したパブリッククラウドサービスのご紹介
Engineering SIDE
OpenStack Diablo: お名前.com VPS KVM 顧客側ネットワーク
OpenStack Diablo : お名前.com VPS KVM サービス側のネットワーク
・Global IPのセグメントは/24単位で物理ルーター(L3)に設定
・Global IPのセグメントは、VLANで管理されている
・OpenStackのnova-networkにネットワークの設定追加
・vmに1 IPごと払いだされる
!
Diabloの当時、Quantumは開発が始まったばかりで、複雑な構成はできなかった
Multiple Flat Network
Physical Router
gw: 10.0.0.1
Shared Network
10.0.0.0/24
Tenant A
vm 1
10.0.0.2
gw: 10.0.2.1
Shared Network
10.0.2.0/24
Tenant B
vm 2
10.0.0.4
Tenant C
vm 1
10.0.2.5
Tenant B
vm 1
10.0.2.3
Tenant A
vm 2
10.0.2.6
13
15. OpenSackを採用したパブリッククラウドサービスのご紹介
Engineering SIDE
OpenStack Grizzly: ConoHa VPS KVM ネットワーク
l3-agent
Internet
は使わずHWまたはアプライア
ンスのL3を使用
コンパネ系
L3 SW
L3 SW
サービス系
顧客global IPネットワーク
会員/課金 DB
API系global IPネットワーク
nova Compute
nova Compute
nova Compute
nova Compute
nova Compute
vm
nova Compute
nova Compute
nova Compute
nova Compute
nova Compute
vm vm
Manage Hosts
vm
sftp
dhcp
vm
sftp
quantum
RAID 10 local disk
API / Manage
コンパネweb (.Net)
API / Manage
mysql
RAID 10 local disk
db
API
管理系
Manage Hosts
vm
vm
console
sftp
db
quantum DB
gre tunnel
vm
console
console
vm
console
vnc
vm
API / Manage
MariaDB
db
nova DB
keystone DB
glance DB
API/nova Manage
Keystone
Glance
glance
image
vm
mq
mq
vm
mq
ldap
Manageネットワーク (API, DB, mq)
Storage
ISO storage
(GlusterFS x4 Node)
Storageネットワーク (Glance API, Storage)
Storage
16. OpenSackを採用したパブリッククラウドサービスのご紹介
Engineering SIDE
OpenStack Grizzly: ConoHa VPS KVM 顧客側ネットワーク
OpenStack Grizzly : ConoHa VPS KVM サービス側のネットワーク
・Global IPのセグメントは/23(IPv4), /64(IPv6)単位で物理ルーター(L3)に設定
・Global IPのセグメントは、VLANで管理、ovsで動的設定
・OpenStackのQuantumにネットワークの設定追加
・vmに初期は1 IPごと払いだされる。別VLANからオプションとしてIPv4 x16まで追加
払い出し、ovsによるOverlayネットワークにより、L2のPrivateネットワークを顧客のテ
ナントに作成可能(無料)
Multiple Flat and Multiple Private Network in Overlay
!
=>自由な顧客ネットワーク
の設置が可能になった
(階層型ネットワーク)
!
顧客のサービスの
スケールアウトに対応
Physical Router
gw: 10.0.0.1
Shared Network
10.0.0.0/24
Tenant A
vm 1
10.0.0.2
172.21.0.2
gw: 10.0.2.1
Shared Network
10.0.2.0/24
Tenant B
vm 2
10.0.0.4
172.21.0.4
Tenant C
vm 1
10.0.2.5
Tenant B Private Network
172.21.0.0/24
Tenant A Private Network
172.21.0.0/24
overlay tunnel
Tenant B
vm 1
10.0.2.3
172.21.0.3
Tenant A
vm 2
10.0.2.6
172.21.0.6
21. OpenSackを採用したパブリッククラウドサービスのご紹介
Engineering SIDE
ConoHa実装 : shutoff (ACPI shutdown) (2)
--- nova-stable-grizzly/nova/virt/libvirt/driver.py 2013-11-19 17:59:31.000000000 +0900
+++ usr/share/pyshared/nova/virt/libvirt/driver.py
2013-11-15 01:13:34.000000000 +0900
!
>> snip(抜粋) <<
def patch_tpool_proxy():
"""eventlet.tpool.Proxy doesn't work with old-style class in __str__()
@@ -690,6 +701,76 @@
for (network, mapping) in network_info:
self.vif_driver.unplug(instance, (network, mapping))
!
+
+
+
+
+
+
+
+
+
def _shutoff(self, instance):
try:
virt_dom = self._lookup_by_name(instance['name'])
except exception.NotFound:
virt_dom = None
# If the instance is already terminated, we're still happy
# Otherwise, destroy it
old_domid = -1
21
22. OpenSackを採用したパブリッククラウドサービスのご紹介
Engineering SIDE
ConoHa実装 : shutoff (ACPI shutdown) (3)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
if virt_dom is not None:
try:
old_domid = virt_dom.ID()
#virt_dom.destroy()
virt_dom.shutdown()
except libvirt.libvirtError as e:
is_okay = False
errcode = e.get_error_code()
if errcode == libvirt.VIR_ERR_OPERATION_INVALID:
# If the instance is already shut off, we get this:
# Code=55 Error=Requested operation is not valid:
# domain is not running
(state, _max_mem, _mem, _cpus, _t) = virt_dom.info()
state = LIBVIRT_POWER_STATE[state]
if state == power_state.SHUTDOWN:
is_okay = True
if not is_okay:
with excutils.save_and_reraise_exception():
LOG.error(_("Error from libvirt during shutoff. "
"Code=%(errcode)s Error=%(e)s") %
locals(), instance=instance)
def _wait_for_shutoff(expected_domid):
"""Called at an interval until the VM is gone."""
# NOTE(vish): If the instance disappears during the destroy
#
we ignore it so the cleanup can still be
#
attempted because we would prefer destroy to
#
never fail.
22
23. OpenSackを採用したパブリッククラウドサービスのご紹介
Engineering SIDE
ConoHa実装 : shutoff (ACPI shutdown) (4)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
def _wait_for_shutoff(expected_domid):
"""Called at an interval until the VM is gone."""
# NOTE(vish): If the instance disappears during the destroy
#
we ignore it so the cleanup can still be
#
attempted because we would prefer destroy to
#
never fail.
try:
dom_info = self.get_info(instance)
state = dom_info['state']
new_domid = dom_info['id']
except exception.NotFound:
LOG.error(_("During wait shutoff, instance disappeared."),
instance=instance)
raise utils.LoopingCallDone()
if state == power_state.SHUTDOWN:
LOG.info(_("Instance shutoff successfully."),
instance=instance)
raise utils.LoopingCallDone()
# NOTE(wangpan): If the instance was booted again after destroy,
#
this may be a endless loop, so check the id of
#
domain here, if it changed and the instance is
#
still running, we should destroy it again.
# see https://bugs.launchpad.net/nova/+bug/1111213 for more details
if new_domid != expected_domid:
LOG.info(_("Instance may be started again."),
instance=instance)
kwargs['is_running'] = True
raise utils.LoopingCallDone()
23
24. OpenSackを採用したパブリッククラウドサービスのご紹介
Engineering SIDE
ConoHa実装 : shutoff (ACPI shutdown) (5)
+
+
+
+
+
+
+
kwargs = {'is_running': False}
timer = utils.FixedIntervalLoopingCall(_wait_for_shutoff, old_domid)
timer.start(interval=0.5).wait()
if kwargs['is_running']:
LOG.info(_("Going to shutoff instance again."), instance=instance)
self._shutoff(instance)
def _destroy(self, instance):
try:
virt_dom = self._lookup_by_name(instance['name'])
@@ -714,11 +795,6 @@
state = LIBVIRT_POWER_STATE[state]
if state == power_state.SHUTDOWN:
is_okay = True
24