vmware-archive / cliaas

an iaas agnostic cli to perform blue green ops manager rotations
Apache License 2.0
5 stars 7 forks source link

cliaas

cliaas wraps multiple IaaS-specific libraries to perform some IaaS-agnostic functions. Presently it only supports upgrading a Pivotal Cloud Foundry Operations Manager VM.

Using master from this repo directly may result in breaking the pipelines that consume it. Tracking master is considered unstable. Please use the official releases, or the pcf-pipelines release on Pivotal Network.

Installing

Download the latest release.

Install from source

Requirements:

mkdir -p $GOPATH/src/github.com/pivotal-cf
git clone --depth 1 https://github.com/pivotal-cf/cliaas $GOPATH/src/github.com/pivotal-cf/cliaas
cd $GOPATH/src/github.com/pivotal-cf/cliaas
glide install
go install github.com/pivotal-cf/cliaas/cmd/cliaas

Usage

cliaas -c config.yml replace-vm --identifier vm-identifier

Config

The -c, --config= flag is for specifying a YAML file with IaaS-specific configuration options to use when running a command. The config should only contain the configuration for a single IaaS for now.

AWS-specific Config

cat > config.yml <<EOF
  aws:
    access_key_id: example-access-key-id
    secret_access_key: example-secret-access-key
    region: us-east-1
    vpc: vpc-12345678
    ami: ami-019e4617
EOF

Notes:

GCP-specific Config

cat > config.yml <<EOF
  gcp:
    credfile: /tmp/gcp-creds.json
    zone: us-east-1
    project: my-gcp-projectname
    disk_image_url: opsmanager-disk-image-url 
EOF

Azure-specific Config

!!! The replace-vm call on Azure will DELETE the current ops manager vm when standing up the new version. This behavior is different than other IaaS' so be warned !!!

cat > config.yml <<EOF
  azure:
    vhd_image_url: xxxx
    subscription_id: xxxxxx 
    client_id: xxxxx
    client_secret: xxxxx
    tenant_id: xxxxx
    resource_group_name: xxxxx
    resource_manager_endpoint: xxxxx
    storage_account_name: xxxx
    storage_account_key: xxxx
    storage_container_name: xxxx
    storage_url: xxxx
    vm_admin_password: xxxxx
EOF

The VM identifier is used to find the VM by name in the IaaS.

Image values in config.yml

Developing

go install github.com/onsi/ginkgo/ginkgo
ginkgo -r -p -race -skipPackage integration