This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"net/url" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'fog' | |
require 'yaml' | |
require 'erb' | |
class Server | |
attr_accessor :api | |
attr_accessor :name | |
attr_accessor :provider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.search_ip(provider, server_name) | |
if provider == "openstack" then | |
server = Fog::Compute.new({ | |
:provider => provider, | |
:openstack_auth_url => ENV['OS_AUTH_URL'] || "", | |
:openstack_username => ENV['OS_USERNAME'] || "", | |
:openstack_tenant => ENV['OS_TENANT_NAME'] || "", | |
:openstack_api_key => ENV['OS_API_KEY'] || "", | |
:openstack_region => ENV['OS_REGION_NAME'] || "" | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add rules to security groups | |
app_sg_id = find_sg_id('sg-all-from-app-net') | |
$conn.create_security_group_rule(app_sg_id, 'tcp', '1', '65535', sg_cidr) | |
$conn.create_security_group_rule(app_sg_id, 'icmp', '-1', '-1', sg_cidr) | |
dbs_sg_id = find_sg_id('sg-all-from-dbs-net') | |
$conn.create_security_group_rule(dbs_sg_id, 'tcp', '1', '65535', sg_cidr) | |
$conn.create_security_group_rule(dbs_sg_id, 'icmp', '-1', '-1', sg_cidr) | |
$conn = nil | |
$conn = Fog::Compute.new({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -u ~/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/fog-1.24.0/lib/fog/openstack/requests/network/create_subnet.rb.org ~/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/fog-1.24.0/lib/fog/openstack/requests/network/create_subnet.rb | |
--- /home/thirai/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/fog-1.24.0/lib/fog/openstack/requests/network/create_subnet.rb.org 2014-11-26 13:38:27.676953155 +0900 | |
+++ /home/thirai/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/fog-1.24.0/lib/fog/openstack/requests/network/create_subnet.rb 2014-11-26 13:38:47.384952650 +0900 | |
@@ -14,8 +14,16 @@ | |
vanilla_options = [:name, :gateway_ip, :allocation_pools, | |
:dns_nameservers, :host_routes, :enable_dhcp, | |
:tenant_id] | |
+ # vanilla_options.reject{ |o| options[o].nil? }.each do |key| | |
+ # data['subnet'][key] = options[key] | |
+ # end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl -L https://www.opscode.com/chef/install.sh | sudo bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
quantum router-gateway-clear ${INT_ROUTER_ID} | |
quantum net-create --tenant-id $tenant public01 \ | |
--provider:network_type flat \ | |
--provider:physical_network physnet1 \ | |
--router:external=True | |
quantum subnet-create --tenant-id ${TENANT_ID} --name ext_subnet --gateway=${EXT_NET_GATEWAY} --allocation-pool start=${EXT_NET_START},end=${EXT_NET_END} ${EXT_NET_ID} ${EXT_NET_RANGE} -- --enable_dhcp=False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oct 24 12:09:42 grizzly0403 ovs-vsctl: 00001|vsctl|INFO|Called as /usr/bin/ovs-vsctl --timeout=2 -- --if-exists del-port br-int patch-tun | |
Oct 24 12:09:42 grizzly0403 ovs-vsctl: 00001|vsctl|INFO|Called as /usr/bin/ovs-vsctl --timeout=2 -- --if-exists del-port br-int int-br-eth1 | |
Oct 24 12:09:42 grizzly0403 kernel: [62806.932529] device int-br-eth1 left promiscuous mode | |
Oct 24 12:09:42 grizzly0403 kernel: [62806.949230] kvm: 9522: cpu0 unhandled wrmsr: 0x38f data f | |
Oct 24 12:09:42 grizzly0403 ovs-vsctl: 00001|vsctl|INFO|Called as /usr/bin/ovs-vsctl --timeout=2 -- --if-exists del-port br-eth1 phy-br-eth1 | |
Oct 24 12:09:42 grizzly0403 kernel: [62806.973292] device phy-br-eth1 left promiscuous mode | |
Oct 24 12:09:43 grizzly0403 ovs-vsctl: 00001|vsctl|INFO|Called as /usr/bin/ovs-vsctl --timeout=2 -- --may-exist add-port br-int int-br-eth1 | |
Oct 24 12:09:43 grizzly0403 kernel: [62807.126934] device int-br-eth1 entered promiscuous mode | |
Oct 24 12:09:43 grizzly0403 ovs-vsctl: 00001|vsctl|INFO|Called as /usr/bin/ovs-vsctl --ti |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
network $ sudo ovs-vsctl list interface br-tun | |
[sudo] password for thirai: | |
_uuid : 74fbe10f-5b52-4594-86a6-e5bf4af2d4a4 | |
admin_state : up | |
cfm_fault : [] | |
cfm_fault_status : [] | |
cfm_health : [] | |
cfm_mpid : [] | |
cfm_remote_mpids : [] | |
cfm_remote_opstate : [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gem install fog | |
Fetching: builder-3.2.2.gem (100%) | |
Successfully installed builder-3.2.2 | |
Fetching: excon-0.27.6.gem (100%) | |
Successfully installed excon-0.27.6 | |
Fetching: formatador-0.2.4.gem (100%) | |
Successfully installed formatador-0.2.4 | |
Fetching: multi_json-1.8.2.gem (100%) | |
Successfully installed multi_json-1.8.2 | |
Fetching: mime-types-1.25.gem (100%) |
NewerOlder