Skip to content

Instantly share code, notes, and snippets.

View jameswnl's full-sized avatar

James Wong jameswnl

View GitHub Profile
{"MOR":"dvs-138", "config":{"uuid":"72 e1 2a 50 23 7a 6f 8c-2a 0d ed 82 3f 77 4a ab", "name":"DC1_DVS", "numStandalonePorts":"0", "numPorts":"384", "maxPorts":"2147483647", "uplinkPortPolicy":{"uplinkPortName":["uplink1", "uplink2", "uplink3", "uplink4"]}, "uplinkPortgroup":["dvportgroup-139"], "defaultPortConfig":{"blocked":{"inherited":"false", "value":"false"}, "vmDirectPathGen2Allowed":{"inherited":"false", "value":"false"}, "inShapingPolicy":{"inherited":"false", "enabled":{"inherited":"false", "value":"false"}, "averageBandwidth":{"inherited":"false", "value":"100000000"}, "peakBandwidth":{"inherited":"false", "value":"100000000"}, "burstSize":{"inherited":"false", "value":"104857600"}}, "outShapingPolicy":{"inherited":"false", "enabled":{"inherited":"false", "value":"false"}, "averageBandwidth":{"inherited":"false", "value":"100000000"}, "peakBandwidth":{"inherited":"false", "value":"100000000"}, "burstSize":{"inherited":"false", "value":"104857600"}}, "vendorSpecificConfig":{"inherited":"false"}, "net
DB migration plan for VMware Distributed vSwitch support:
PR1:
1. update table switches.uid_ems = switches.host_id + "|" + switches.uid_ems
2. add index to switches on field uid_ems :uniquness => true
(VDS already has its uid_ems natural unique, this migration is to enforce that for local vSwitches)
PR2:
1. create a join table between hosts and switches, host_switches
2. populate (host_switches.host_id, host_switches.uid_ems) = (switches.host_id, switches.uid_ems)
#https://boto3.readthedocs.org/en/latest/reference/services/cloudwatch.html
import boto3
client = boto3.client('cloudwatch')
r2=client.get_metric_statistics(Namespace='AWS/EC2', MetricName='CPUUtilization',Statistics=['SampleCount'],StartTime=datetime(2015, 7, 19), EndTime=datetime(2015, 7, 20), Period=120, Dimensions=[{'Name': 'InstanceId', 'Value': 'i-6a469f90'}])
runs=[]
for status in ec2.meta.client.describe_instance_status()['InstanceStatuses']:
runs.append(status)
### after running this, manually update the Name tag and assign EIP. Run the bbin.yml playbook
- hosts: localhost
name: Provision kyoto
connection: local
gather_facts: False
vars:
- ami_id: ami-6bceb41c # with 1x500GB EBS
- key_name: operations
- hosts: localhost
name: Provision play
connection: local
gather_facts: False
vars:
- ami_id: ami-78fc7410
- key_name: operations
- username: jameswong
tasks:
- name: Provision a set of instances
@jameswnl
jameswnl / gist:5fa3ac8e60915a7ddf59
Created August 5, 2014 03:09
sequence IQ multi-node hadoop cluster on dockers output
bash-3.2$ . .amb && amb-deploy-cluster
starting an ambari cluster with: 3 nodes
[DEBUG] docker run -d --dns 127.0.0.1 --entrypoint /usr/local/serf/bin/start-serf-agent.sh -e KEYCHAIN= --name amb0 -h amb0.mycorp.kom sequenceiq/ambari --tag ambari-server=true
2ee6cc6983649f442e68966a9275669460b4ca7c96a9a1c850609f9878069899
[DEBUG] docker run -d -e SERF_JOIN_IP=172.17.0.18 --dns 127.0.0.1 --entrypoint /usr/local/serf/bin/start-serf-agent.sh -e KEYCHAIN= --name amb1 -h amb1.mycorp.kom sequenceiq/ambari --log-level debug
ebf5b14c05ff44eb3b4c426b40f5d7221a50cd09bc5104eecc65afb4a9d93f51
[DEBUG] docker run -d -e SERF_JOIN_IP=172.17.0.18 --dns 127.0.0.1 --entrypoint /usr/local/serf/bin/start-serf-agent.sh -e KEYCHAIN= --name amb2 -h amb2.mycorp.kom sequenceiq/ambari --log-level debug
cb189ec23808fe782c5aa2244bd5ea9d74f7abb6c42bd63e1cb2969149d596cb
[DEBUG] docker run -it --rm -e EXPECTED_HOST_COUNT=3 -e BLUEPRINT=multi-node-hdfs-yarn --link amb0:ambariserver --entrypoint /bin/sh sequenceiq/ambari -c /tmp/install-cluste