cloud-barista / poc-mcism

Proof-of-Concept for Cloud-Barista Multi-Cloud Infra Service (MCIS) Management Framework
Apache License 2.0
3 stars 2 forks source link

NOTE

This repository is no longer actively maintained,

please see https://github.com/cloud-barista/cb-tumblebug.

poc-mcism (Multi-Cloud Infra Service Management)

Proof of Concepts for the Cloud-Barista Multi-Cloud Project.


[목차]

  1. 설치 개요
  2. 설치 절차
  3. 설치 & 실행 상세 정보
  4. 결과 확인

[설치 개요]

[설치 절차]

[설치 & 실행 상세 정보]

클라우드 인증 키 생성 및 설정

AWS 인증 키 생성 및 설정

GCE 인증 키 생성 및 설정

Azure 인증 키 생성 및 설정

mcism_master 환경 설정 (개인 환경에 맞춰 설정)

#### Config for mcism PoC ####

# Infos of etcd server
etcdserverport: "<ETCD-Host-IPAddress>:2379"

## Config for AWS ##
aws:

# Infos of Region
  region: ap-northeast-2
# Infos for creating Instnaces
  imageid: ami-02c9728b733d27242 # Ubuntu Server 18.04 LTS (HVM), SSD Volume Type
  instancenameprefix: jhseo-test  # EC2's Tag Name for group instances' ID
  instancetype: t2.nano
  securitygroupid: sg-08bd014b5e4301625 # jhseo-test
  subnetid: subnet-da654b97
# for VM
  username: ubuntu
  keyname: ETRI-jhseo-key
  keyfilepath: /root/.aws/ETRI-jhseo-key.pem

## Config for GCP ##
gcp:

# for credential
  credentialfile: /root/.gcp/gcp-etri-jhseo-test-ed06e580674a.json
# Infos of Region
  region: asia-northeast2
  zone: asia-northeast2-a
# Project & Prefix for GCP
  projectid: etri-jhseo-test
  prefix: https://www.googleapis.com/compute/v1/projects/etri-jhseo-test
# Infos for creating Instnaces
  imageid: projects/ubuntu-os-cloud/global/images/ubuntu-1804-bionic-v20190530
  instancenameprefix: jhseo-test
  instancetype: https://www.googleapis.com/compute/v1/projects/etri-jhseo-test/zones/asia-northeast2-a/machineTypes/f1-micro
  subnetid: https://www.googleapis.com/compute/v1/projects/etri-jhseo-test/regions/asia-northeast2/subnetworks/default
  networkname: https://www.googleapis.com/compute/v1/projects/etri-jhseo-test/global/networks/default
  serviceAccoutsMail: default
# for VM
  username: jhseo
  keyname: empty
  keyfilepath: /root/.gcp/gce-vm-key

## Config for AZURE ##
azure:

# for credential
  credentialfile: /root/.azure/azure.auth

  groupname: VMGroupName
  location: koreasouth
  virtualnetworkname: virtualNetworkName
  subnet1name: subnet1Name
  subnet2name: subnet2Name
  networksecuritygroupname: nsgName
#  ipname: "ipName"
#  nicname: "nicName"

  basename: azurejhseo
  username: jhseo
  password:
  keyfilepath: /root/.azure/azure-vm-key
  publickeyfilepath: /root/.azure/azure-vm-key.pub

mcism 빌드

mcism_master 실행

[Select opt (0:API-server, 1:create-vm, 2:delete-vm, 3:list-vm, 4:monitor-vm]
Your section : 1
1
[Select cloud service provider (1:aws, 2:gcp, 3:azure, 4:TBD]
Your section : 1
[Provide the number of VM to create (e.g., 5)
Your section : 2
Create VM(s) in aws
######### addVMaws....
Successfully tagged instance:aws-etri-shson0
Successfully tagged instance:aws-etri-shson1

$ ./mcism_master

[Select opt (0:API-server, 1:create-vm, 2:delete-vm, 3:list-vm, 4:monitor-vm]
Your section : 3
3
connected to etcd - 10.0.2.15:2379
######### all server list....(2)
[CSP] aws / [VmID] i-0f6733dc8455fb3ac / [IP] :2019
[CSP] aws / [VmID] i-0e3b84c8cecba48a2 / [IP] :2019

API SERVER 실행 시, 클라이언트에서 TEST 방법

Non interactive 모드

$ go run mcism_master.go -addvm-aws=3

## examples ##
go run mcism_master.go -addvm-aws=10
go run mcism_master.go -addvm-gcp=5
go run mcism_master.go -addvm-azure=5

go run mcism_master.go -listvm
go run mcism_master.go -monitor

go run mcism_master.go -delvm-aws
go run mcism_master.go -delvm-gcp
go run mcism_master.go -delvm-azure

######### addVMaws....
Successfully tagged instance:aws-etri-shson0
Successfully tagged instance:aws-etri-shson1
Successfully tagged instance:aws-etri-shson2
==============> 54.180.134.106
==============> 52.78.23.193
==============> 52.78.80.176
Couldn't establisch a connection to the remote server  dial tcp 54.180.134.106:22: connect: connection refused
connected to etcd - 10.0.2.15:2379
######### addServer....54.180.134.106:2019
added a 54.180.134.106:2019 into the Server List...

######### addServer....52.78.23.193:2019
added a 52.78.23.193:2019 into the Server List...

######### addServer....52.78.80.176:2019
added a 52.78.80.176:2019 into the Server List...

$ ./mcism_master -listvm

connected to etcd - 10.0.2.15:2379
######### all server list....(4)
52.231.161.155:2019
52.78.80.176:2019
54.180.134.106:2019
52.78.23.193:2019

$ ./mcism_master –monitor

######### monitoring all servers....
connected to etcd - 10.0.2.15:2379
[azureshson0]
2019-05-24 14:07:59.110989 I |   [CPU USG] C0:0.96%
2019-05-24 14:07:59.110997 I |   [MEM USG] TOTAL: 646MB, USED: 244MB, FREE: 97MB
2019-05-24 14:07:59.111000 I |   [DSK RAT]/dev/sda1: R/s:   82812928, W/s:   621621248  /dev/sdb1: R/s:   0, W/s:   0
-----------
[ip-172-31-4-191]
2019-05-24 14:07:59.138355 I |   [CPU USG] C0:1.59%
2019-05-24 14:07:59.138368 I |   [MEM USG] TOTAL: 983MB, USED: 96MB, FREE: 525MB
2019-05-24 14:07:59.138375 I |   [DSK RAT]/dev/xvda1: R/s:   286658048, W/s:   244248576    /dev/loop0: R/s:   3213312, W/s:   0    /dev/loop1: R/s:   3756032, W/s:   0
-----------
[ip-172-31-4-246]
2019-05-24 14:07:59.163055 I |   [CPU USG] C0:5.21%
2019-05-24 14:07:59.163063 I |   [MEM USG] TOTAL: 983MB, USED: 97MB, FREE: 520MB
2019-05-24 14:07:59.163065 I |   [DSK RAT]/dev/xvda1: R/s:   289209856, W/s:   244568064
-----------
[ip-172-31-0-32]
2019-05-24 14:07:59.178435 I |   [CPU USG] C0:3.94%
2019-05-24 14:07:59.178478 I |   [MEM USG] TOTAL: 983MB, USED: 94MB, FREE: 523MB
2019-05-24 14:07:59.178488 I |   [DSK RAT]/dev/xvda1: R/s:   289177088, W/s:   244695040
-----------
==============================
connected to etcd - 10.0.2.15:2379
[azureshson0]
2019-05-24 14:08:00.224434 I |   [CPU USG] C0:1.79%
2019-05-24 14:08:00.224442 I |   [MEM USG] TOTAL: 646MB, USED: 244MB, FREE: 97MB
2019-05-24 14:08:00.224445 I |   [DSK RAT]/dev/sda1: R/s:   0, W/s:   4096  /dev/sdb1: R/s:   0, W/s:   0
-----------
[ip-172-31-4-191]
2019-05-24 14:08:00.241459 I |   [CPU USG] C0:0.00%
2019-05-24 14:08:00.241482 I |   [MEM USG] TOTAL: 983MB, USED: 96MB, FREE: 524MB
2019-05-24 14:08:00.241489 I |   [DSK RAT]/dev/xvda1: R/s:   0, W/s:   4096 /dev/loop0: R/s:   0, W/s:   0  /dev/loop1: R/s:   0, W/s:   0
-----------
[ip-172-31-4-246]
2019-05-24 14:08:00.260265 I |   [CPU USG] C0:0.00%
2019-05-24 14:08:00.260272 I |   [MEM USG] TOTAL: 983MB, USED: 97MB, FREE: 520MB
2019-05-24 14:08:00.260275 I |   [DSK RAT]/dev/xvda1: R/s:   0, W/s:   4096
-----------
[ip-172-31-0-32]
2019-05-24 14:08:00.280212 I |   [CPU USG] C0:0.00%
2019-05-24 14:08:00.280228 I |   [MEM USG] TOTAL: 983MB, USED: 94MB, FREE: 523MB
2019-05-24 14:08:00.280286 I |   [DSK RAT]/dev/xvda1: R/s:   0, W/s:   4096
-----------
==============================

$ ./mcism_master -delvm-aws

######### delete all servers in AWS....
connected to etcd - 10.0.2.15:2379
connected to etcd - 10.0.2.15:2379
######### delete aws all Server....
deleted all aws server list...