24
Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | Cloud Stack Managerで実現する Infrastructure as Code マルチ・クラウドサービス管理 Cloud Stack Manager 20161116日本オラクル株式会社 クラウド・テクノロジー事業統括 Fusion Middleware事業本部 柳原 伸弥 1

Cloud Stack Managerで実現するInfrastructure as Code

Embed Size (px)

Citation preview

Page 1: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Cloud Stack Managerで実現する Infrastructure as Code マルチ・クラウドサービス管理 – Cloud Stack Manager

2016年11月16日 日本オラクル株式会社 クラウド・テクノロジー事業統括 Fusion Middleware事業本部 柳原 伸弥

1

Page 2: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

以下の事項は、弊社の一般的な製品の方向性に関する概要を説明するものです。また、情報提供を唯一の目的とするものであり、いかなる契約にも組み込むことはできません。以下の事項は、マテリアルやコード、機能を提供することをコミットメント(確約)するものではないため、購買決定を行う際の判断材料になさらないで下さい。オラクル製品に関して記載されている機能の開発、リリースおよび時期については、弊社の裁量により決定されます。

Oracleは、米国オラクルコーポレーション及びその子会社、関連会社の米国及びその他の国における登録商標です。文中の社名、商品名等は各社の商標または登録商標である場合があります。

2

Page 3: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Cloud Stack Manager概要 複数のクラウドサービスを一括管理

3

Page 4: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

物理環境 仮想環境 クラウド移行・共存 クラウドネイティブ

クラウド環境利用のロードマップ

4

集約やコスト削減、また自動化や運用コストの削減を求め、 物理から仮想、仮想からクラウドへとシステム環境利用が変遷している

• 物理環境に最適化した構成 • ハードウェアレベルでの分離 • 個別最適した運用モデル

• システムリソースの最適化 • 設備投資の削減 • 仮想化技術による自動化

• 新しいアーキテクチャ • 開発モデルや運用モデルの 革新

• 投資モデルの変化

APP DB

APP DB

APP DB

APP DB 仮想環境 仮想環境

• 設備投資の削減 • 運用コストの削減 • クラウド機能の活用による 開発/運用性の向上

Page 5: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

クラウド環境利用のメリット

5

オンプレミス環境と比較して容易に環境構築が可能

物理環境 仮想環境 クラウド移行・共存 クラウドネイティブ

• 物理環境に最適化した構成 • ハードウェアレベルでの分離 • 個別最適した運用モデル

• システムリソースの最適化 • 設備投資の削減 • 仮想化技術による自動化

• 新しいアーキテクチャ • 開発モデルや運用モデルの 革新

• 投資モデルの変化

APP DB

APP DB

APP DB

APP DB 仮想環境 仮想環境

• 設備投資の削減 • 運用コストの削減 • クラウド機能の活用による 開発/運用性の向上

物理環境の調達が不要

インストール作業不要の整品利用

クラウド提供運用機能の利用

廃棄・再構築が容易

Page 6: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

クラウド環境構築時の悩み

6

複数のクラウドサービス環境の構築作業が冗長

物理環境 仮想環境 クラウド移行・共存 クラウドネイティブ

• 物理環境に最適化した構成 • ハードウェアレベルでの分離 • 個別最適した運用モデル

• システムリソースの最適化 • 設備投資の削減 • 仮想化技術による自動化

• 新しいアーキテクチャ • 開発モデルや運用モデルの 革新

• 投資モデルの変化

APP DB

APP DB

APP DB

APP DB 仮想環境 仮想環境

• 設備投資の削減 • 運用コストの削減 • クラウド機能の活用による 開発/運用性の向上

クラウドサービスの前提となるサービスの作成作業が冗長

複数のクラウドサービスを組み合わせ構成の失敗時の手戻りが大変

同一構成のクラウド環境を別のデータセンターに用意する作業が冗長

画面入力のミスが環境作成後に判明

Page 7: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Oracle Cloud Platformでのマルチ・サービス環境管理

7

複数のクラウドサービスをCloud Stackという単位で構築・管理を実施

Cloud Stackテンプレート Cloud Stack

Page 8: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

複数のクラウドサービスの一括管理 Cloud Stack Manager

8

複数のサービスをまとめて構成・管理

一括したインスタンス作成と削除

テンプレートベースの環境の再現性

Cloud Stack

YAML形式のシンプルな構成

容易なカスタマイズ

テンプレートベースのCloud Stack Managerで複数のサービスを簡単に構築

Cloud Stack テンプレート

Page 9: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Cloud Stack Manager – ワークフロー詳細 Cloud Stack Managerによるオーケストレーション

9

Page 10: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Oracle Cloud Stack ManagerにStack Templateをインポート ※Validationも同時に行われる

Stack Templateの妥当性チェック YAMLのシンタックスチェックやパラメータチェックを実施

YAMLフォーマットによる Stack Templateの作成 Stack Templateは以下の要素から構成される • Resource • Parameter • Attribute

Cloud Stack Managerのワークフロー

10

Stack Templateの 作成

Stack Templateの 確認

Stack Templateの インポート

Stack Templateを選択し、構成情報を元に複数のクラウド・サービスをオーケストレーションして生成する

Cloud Stackの 作成

Cloud Stackを削除すると、生成されている複数のクラウド・サービスがまとめて削除される

Cloud Stackの 削除

クラウドサービスの設計図と言えるテンプレートを作成 テンプレートからCloud Stackをプロビジョニング

Page 11: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Stack Templateの作成

11

テンプレートは、以下の3要素を含むYAML形式で構成される • Resources • Parameters • Attributes

Cloud Stack テンプレート

構成するクラウドサービスのリソース定義

Resources

定義するリソースに設定する要素値 事前にユーザによる設定を行う項目

Parameters

定義するリソースに設定する要素値 インスタンス構成後に動的に設定される項目

Attributes

Page 12: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Stack Templateの例

12

--- template: templateName: Java-DB-Template templateVersion: 1.0.0 templateDescription: "JCS and DBCS template" parameters: wlVersion: label: JCS Version description: "WLS Version" type: String default: 12.2.1.0 allowedValues: - 12.2.1.0 - 12.1.3.0 wlComputeShape: label: Compute Shape description: "Compute Shape" type: String default: oc3 allowedValues: - oc3 - oc4 - oc3m - oc4m publicKeyText: label: SSH Public Key description: "Public Key Text" type: ssh mandatory: true sensitive: true wlAdminUser: label: Administrator Username description: "WLS Admin User Name" type: String minLength: 8 maxLength: 128

allowedPattern: "[¥¥p{Print}&&[^',<>#&|¥¥?¥¥(¥¥)¥¥{¥¥}¥t ]]++" mandatory: true dbSid: label: DB Name (SID) description: "DB Name (SID)" type: String minLength: 1 maxLength: 8 default: ORCL allowedPattern: "^[a-zA-Z][a-zA-Z0-9]*$" dbVersion: label: DBCS Version description: "DB Version" type: String default: 12.1.0.2 allowedValues: - 12.1.0.2 - 11.2.0.4 commonPwd: label: Password (to access JCS and DBCS) description: "Password to access JCS and DBCS" type: String allowedPattern: "((?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[-_#])(?=[¥¥S]+$).{8,30})" mandatory: true sensitive: true backupStorageContainer: label: Cloud Storage Container description: "Name of the Exiting or new Oracle Storage Cloud Service container" type: String mandatory: true cloudStorageUser: label: Cloud Storage Username description: "Cloud Storage Container User Name"

type: String mandatory: true cloudStoragePassword: label: Cloud Storage Password description: "Cloud Storage Container User Password" type: String mandatory: true sensitive: true dbComputeShape: label: Compute Shape description: "Compute Shape" type: String default: oc3 allowedValues: - oc3 - oc4 - oc5 - oc6 - oc1m - oc2m - oc3m - oc4m dbStorage: label: Usable Database Storage (GB) description: "Database Storage in GB" type: Number default: 25 parameterGroups: - label: Backup and Recovery Configuration parameters: - backupStorageContainer - cloudStorageUser - cloudStoragePassword - label: Stack Access parameters:

Page 13: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Stack Templateの例

13

- commonPwd - publicKeyText - label: Oracle Database Cloud Service Details parameters: - dbVersion - dbComputeShape - dbSid - dbStorage - label: Oracle Java Cloud Service Details parameters: - wlVersion - wlComputeShape - wlAdminUser resources: backupContainer: type: OSS.Container parameters: cloudStorageContainer: Fn::GetParam: backupStorageContainer cloudStorageUser: Fn::GetParam: cloudStorageUser cloudStoragePassword: Fn::GetParam: cloudStoragePassword jcs: type: jaas parameters: serviceName: Fn::Join: - "-" - - Fn::GetParam: serviceName - JAAS cloudStorageContainer: Fn::GetParam: backupStorageContainer cloudStorageUser:descriptor

Fn::GetParam: cloudStorageUser cloudStoragePassword: Fn::GetParam: cloudStoragePassword parameters: - VMsPublicKey: Fn::GetParam: publicKeyText adminUserName: Fn::GetParam: wlAdminUser adminPassword: Fn::GetParam: commonPwd dbServiceName: Fn::GetAtt: - dbcs - serviceName dbaName: sys dbaPassword: Fn::GetParam: commonPwd shape: Fn::GetParam: wlComputeShape type: weblogic version: Fn::GetParam: wlVersion depends_on: - backupContainer dbcs: type: dbaas parameters: serviceName: Fn::Join: - "-" - - Fn::GetParam: serviceName - DBAAS version:

Fn::GetParam: dbVersion level: PAAS edition: SE shape: Fn::GetParam: dbComputeShape vmPublicKeyText: Fn::GetParam: publicKeyText parameters: - type: db adminPassword: Fn::GetParam: commonPwd sid: Fn::GetParam: dbSid failoverDatabase: no backupDestination: BOTH timezone: UTC charset: AL32UTF8 ncharset: AL16UTF16 cloudStorageContainer: Fn::GetParam: backupStorageContainer cloudStorageUser: Fn::GetParam: cloudStorageUser cloudStoragePwd: Fn::GetParam: cloudStoragePassword usableStorage: Fn::GetParam: dbStorage depends_on: - backupContainer attributes: OraConnectString: value: Fn::GetAtt: - dbcs - components.DB_1.attributes.CONNECT_DESCRIPTOR description: DBCS connect descriptor

Resource このテンプレートでは3種 リソース構成を行う

• OSS.Container • jaas • dbaas

Parameter インスタンス作成前に 静的に設定

Attribute 動的にインスタンスから 取得・設定

Page 14: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Stack Templateの確認

14

Resource要素チェックや、 シンタックスチェックなどの Stack Templateの妥当性チェック

Cloud Stack テンプレート

$ psm stack validate-template -f ./Java-DB-Template.yaml ¥ > -p commonPwd:Welcome1# ¥ > backupStorageContainer:Storage-IDDOMAIN/Container_Stack ¥ > cloudStorageUser:shinyay ¥ > cloudStoragePassword:passW0RD ¥ > dbSid:ORCL ¥ > wlAdminUser:weblogic ¥ > publicKeyText:"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZOMmhhCDArA0g392AEZDMdfeUaQ8/KAeni1w2WGy2BYFWlEQ1maNpZ7MD83z4mI2lYzKcXHrexA4VpC/L3AZ6Klfw/sPQb0Xuo7GxHV6zz2VzkqTH3Hd2T8Aiht/BRirRiav+9LRGwefGjJsicp4w9fjcJtCWcvpjHqEqCXs8Y8xd0uCTSCm11h3pZ4AG6bkW8I5BRGjLmhswOhd9jBoZ1hLZgDJlBMi2vQeEgkUmQE3bgeTgokT9YrAqfWR6kpvD8F/dRZw/Dkp/g3y6tEmQ2lPtWv1azfYvhRYBJ74CC1V7vpUMOIUvmlyU/x2rozGSJK4KIWKDBxOsP5Vq5llg shinyay@shinyaPC" { "details":{ "message":"Validation completed. No errors found" } }

$ 妥当性チェック

Page 15: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Stack Templateのインポート

15

作成したStack TemplateをStack Managerにインポートして使用できる状態にする

Cloud Stack テンプレート

$ インポート # psm stack import-template -f ./Java-DB-Template.yaml { "templateName":"Java-DB-Template", "latestVersion":"1.0.0", "description":"JCS and DBCS template", "createdOn":"2016-11-14T06:45:21.298+0000", "createdBy":"shinyay", "state":"PUBLISHED", "type":"USER_TEMPLATE", "links":[ { "rel":"canonical", "href":"https://"psm.europe.oraclecloud.com:443/paas/api/v1.1/instancemgmt/IDDOMAIN/templates/cst/instances/Java-DB-Template }, { "rel":"self", "href":"https://psm.europe.oraclecloud.com:443/paas/api/v1.1/instancemgmt/IDDOMAIN/templates/cst/instances" } ] }

Cloud Stack Manager

Page 16: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Cloud Stackの作成

16

インポート済みのテンプレートからCloud Stackを作成

$ 作成 $ psm stack create -n JavaDB01 ¥ > -t Java-DB-Template ¥ > -d "Cloud Stack from Java-DB-Template" > -f RETAIN ¥ > -p commonPwd:Welcome1# ¥ > backupStorageContainer:Storage-IDDOMAIN/Container_Stack ¥ > cloudStorageUser:shinyay ¥ > cloudStoragePassword:passW0RD ¥ > dbSid:ORCL ¥ > wlAdminUser:weblogic ¥ > publicKeyText:"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZOMmhhCDArA0g392AEZDMdfeUaQ8/KAeni1w2WGy2BYFWlEQ1maNpZ7MD83z4mI2lYzKcXHrexA4VpC/L3AZ6Klfw/sPQb0Xuo7GxHV6zz2VzkqTH3Hd2T8Aiht/BRirRiav+9LRGwefGjJsicp4w9fjcJtCWcvpjHqEqCXs8Y8xd0uCTSCm11h3pZ4AG6bkW8I5BRGjLmhswOhd9jBoZ1hLZgDJlBMi2vQeEgkUmQE3bgeTgokT9YrAqfWR6kpvD8F/dRZw/Dkp/g3y

6tEmQ2lPtWv1azfYvhRYBJ74CC1V7vpUMOIUvmlyU/x2rozGSJK4KIWKDBxOsP5Vq5llg syanagih@SYANAGIH-JP" { "details":{ "message":"Submitted job to create stack [JavaDB01] in domain [IDDOMAIN].", "jobId":"2822679" } } Job ID : 2822679

Cloud Stack Manager

Page 17: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Cloud Stackの作成状況確認

17

Cloud Stack 作成中のアクティビティログをジョブIDより確認

$ 確認 $ psm stack operation-status -j 2822679 { "activityLogId":1267694, "serviceName":"JavaDB01", "serviceType":"cloudstack", "identityDomain":"usprivatejcs", "serviceId":79888, "jobId":2822679, "startDate":"2016-11-14T07:09:38.993+0000", "status":"RUNNING", "operationId":79888, "operationType":"CREATE_SERVICE", "summaryMessage":"CREATE_SERVICE", "authDomain":"usprivatejcs", "authUser":"shinyay", "initiatedBy":"USER", "messages":[ { "activityDate":"2016-11-14T07:09:38.993+0000", "message":"Stack creation request accepted." } ] }

Cloud Stack Manager

Page 18: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

作成されたCloud Stack

18

Cloud Stack Cloud Stackとして統合管理されるマルチ・クラウドサービス

Page 19: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

CLIからの確認

19

CLIからもCloud Stackとして作成したインスタンスが完了している事が確認できる

$ 確認 $ psm stack list { "items":[ { "serviceName":"JavaDB01", "description":"Cloud Stack from Java-DB-Template", "state":"READY", "stateDetail":"Ready", "identityDomain":“IDDOMAIN", "createdBy":"shinyay", "creationJobId":"2822679", "createdOn":"2016-11-14T07:09:38.706+0000", "modifiedOn":"2016-11-14T07:09:38.705+0000", "links":[ { "rel":"canonical", "href":"https://psm.europe.oraclecloud.com:443/paas/api/v1.1/instancemgmt/IDDOMAIN/services/stack/instances/JavaDB01" }, { "rel":"self", "href":"https://psm.europe.oraclecloud.com:443/paas/api/v1.1/instancemgmt/IDDOMAIN/services/stack/instances/JavaDB01" } ] }

Cloud Stack Manager

Page 20: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Cloud Stackの削除

20

Cloud Stack単位での削除実施 •個別のサービス削除が不要 •削除の前後関係や依存関係の考慮が不要

$ 削除 $ psm stack delete –n JavaDB01

Cloud Stack Manager Cloud Stack Manager

Cloud Stack削除後も Stack Templateは保持しているのでCloud Stack 再作成が可能

Cloud Stack Manager

Page 21: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

まとめ

21

Page 22: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. |

Java Cloud Service – Cloud Stack Manager

22

複数のサービスをまとめて構成・管理

一括したインスタンス作成と削除

テンプレートベースの環境の再現性

Cloud Stack

YAML形式のシンプルな構成

容易なカスタマイズ

Java Cloud Service – Cloud Stack Managerを利用し、 容易にクラウド環境構築を実現

Cloud Stack テンプレート

Page 23: Cloud Stack Managerで実現するInfrastructure as Code

Copyright © 2016 Oracle and/or its affiliates. All rights reserved. | 23

Page 24: Cloud Stack Managerで実現するInfrastructure as Code