bosh-director 1.1761.0 → 1.1777.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/bosh-director +4 -4
- data/bin/bosh-director-console +29 -38
- data/bin/bosh-director-drain-workers +12 -11
- data/bin/bosh-director-migrate +17 -18
- data/bin/bosh-director-scheduler +2 -2
- data/bin/bosh-director-worker +10 -10
- data/lib/bosh/director/version.rb +1 -1
- data/lib/cloud/dummy.rb +69 -50
- metadata +18 -18
data/bin/bosh-director
CHANGED
|
@@ -5,8 +5,8 @@ require 'thin'
|
|
|
5
5
|
|
|
6
6
|
config_file = nil
|
|
7
7
|
|
|
8
|
-
opts = OptionParser.new do |
|
|
9
|
-
|
|
8
|
+
opts = OptionParser.new do |op|
|
|
9
|
+
op.on('-c', '--config [ARG]', 'Configuration File') do |opt|
|
|
10
10
|
config_file = opt
|
|
11
11
|
end
|
|
12
12
|
end
|
|
@@ -18,9 +18,9 @@ config = Bosh::Director::Config.load_file(config_file)
|
|
|
18
18
|
|
|
19
19
|
Bosh::Director::App.new(config)
|
|
20
20
|
|
|
21
|
-
thin_server = Thin::Server.new('127.0.0.1', config.hash['port'], :
|
|
21
|
+
thin_server = Thin::Server.new('127.0.0.1', config.hash['port'], signals: false) do
|
|
22
22
|
use Rack::CommonLogger
|
|
23
|
-
map
|
|
23
|
+
map '/' do
|
|
24
24
|
run Bosh::Director::Api::Controller.new
|
|
25
25
|
end
|
|
26
26
|
end
|
data/bin/bosh-director-console
CHANGED
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
-
APP_DIR = File.expand_path(File.join(
|
|
3
|
+
APP_DIR = File.expand_path(File.join('..', '..'), __FILE__)
|
|
4
4
|
|
|
5
|
-
DEFAULT_DIRECTOR_CONFIG = File.join(APP_DIR, "config", "bosh-director.yml")
|
|
6
|
-
|
|
7
|
-
require 'bosh/director'
|
|
8
5
|
require 'irb'
|
|
9
6
|
require 'irb/completion'
|
|
7
|
+
require 'bosh/director'
|
|
10
8
|
require 'rack/test'
|
|
11
9
|
|
|
10
|
+
options = {}
|
|
11
|
+
|
|
12
|
+
OptionParser.new do |opt|
|
|
13
|
+
opt.banner = 'Usage: director_console [options]'
|
|
14
|
+
opt.on('-c', '--config [ARG]', 'configuration file') { |v| options[:config] = v }
|
|
15
|
+
opt.parse!(ARGV)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
config_file = File.join(APP_DIR, 'config', 'bosh-director.yml')
|
|
19
|
+
if options[:config]
|
|
20
|
+
config_file = File.expand_path(options[:config])
|
|
21
|
+
end
|
|
22
|
+
|
|
12
23
|
module Bosh
|
|
13
24
|
module Director
|
|
14
|
-
|
|
15
25
|
class TestApplication
|
|
16
26
|
include Rack::Test::Methods
|
|
17
27
|
|
|
@@ -21,45 +31,27 @@ module Bosh
|
|
|
21
31
|
end
|
|
22
32
|
|
|
23
33
|
class Console
|
|
24
|
-
def
|
|
25
|
-
new.start(context)
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
def start(context)
|
|
29
|
-
options = {}
|
|
30
|
-
|
|
31
|
-
OptionParser.new do |opt|
|
|
32
|
-
opt.banner = "Usage: director_console [options]"
|
|
33
|
-
opt.on('-c', '--config [ARG]', 'configuration file') { |v| options[:config] = v }
|
|
34
|
-
opt.parse!(ARGV)
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
if options[:config]
|
|
38
|
-
config_file = File.expand_path(options[:config])
|
|
39
|
-
else
|
|
40
|
-
config_file = DEFAULT_DIRECTOR_CONFIG
|
|
41
|
-
end
|
|
42
|
-
|
|
34
|
+
def start(context, config_file)
|
|
43
35
|
puts "=> Loading #{config_file}"
|
|
44
|
-
Bosh::Director::
|
|
45
|
-
|
|
46
|
-
context.instance_eval do
|
|
47
|
-
include BD::Models
|
|
48
|
-
end
|
|
36
|
+
config = Bosh::Director::Config.load_file(config_file)
|
|
37
|
+
Bosh::Director::App.new(config)
|
|
49
38
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
puts "=> Debugger enabled"
|
|
53
|
-
rescue LoadError
|
|
54
|
-
puts "=> ruby-debug not found, debugger disabled"
|
|
55
|
-
end
|
|
39
|
+
context.instance_eval { include BD::Models }
|
|
40
|
+
require_ruby_debug
|
|
56
41
|
|
|
57
42
|
puts "=> Welcome to BOSH Director console\n=> You can use 'app' to access REST API"
|
|
58
43
|
puts "=> You can also use 'cloud', 'blobstore', 'nats' helpers to query these services"
|
|
59
|
-
|
|
60
44
|
IRB.start
|
|
61
45
|
end
|
|
62
46
|
|
|
47
|
+
private
|
|
48
|
+
|
|
49
|
+
def require_ruby_debug
|
|
50
|
+
require 'ruby-debug'
|
|
51
|
+
puts '=> Debugger enabled'
|
|
52
|
+
rescue LoadError
|
|
53
|
+
puts '=> ruby-debug not found, debugger disabled'
|
|
54
|
+
end
|
|
63
55
|
end
|
|
64
56
|
end
|
|
65
57
|
end
|
|
@@ -80,5 +72,4 @@ end
|
|
|
80
72
|
end
|
|
81
73
|
end
|
|
82
74
|
|
|
83
|
-
BD::Console.start(self)
|
|
84
|
-
|
|
75
|
+
BD::Console.new.start(self, config_file)
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
-
require
|
|
3
|
+
require 'bosh/director'
|
|
4
4
|
|
|
5
5
|
config_file = nil
|
|
6
6
|
report = false
|
|
7
7
|
active_worker = 1
|
|
8
8
|
|
|
9
|
-
opts = OptionParser.new do |
|
|
10
|
-
|
|
9
|
+
opts = OptionParser.new do |op|
|
|
10
|
+
op.on('-c', '--config [ARG]', 'Configuration File') do |opt|
|
|
11
11
|
config_file = opt
|
|
12
12
|
end
|
|
13
|
-
|
|
13
|
+
op.on('-r', '--report', 'Report 1 if any active worker, 0 otherwise') do
|
|
14
14
|
report = true
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
opts.parse!(ARGV.dup)
|
|
19
19
|
|
|
20
|
-
config_file ||= ::File.expand_path(
|
|
20
|
+
config_file ||= ::File.expand_path('../../config/bosh-director.yml', __FILE__)
|
|
21
21
|
config = Bosh::Director::Config.load_file(config_file)
|
|
22
22
|
|
|
23
23
|
Bosh::Director::App.new(config)
|
|
@@ -25,16 +25,17 @@ Bosh::Director::App.new(config)
|
|
|
25
25
|
logger = Bosh::Director::Config.logger
|
|
26
26
|
|
|
27
27
|
loop do
|
|
28
|
-
logger.info(
|
|
29
|
-
|
|
28
|
+
logger.info('Checking for any workers that are still processing..')
|
|
29
|
+
|
|
30
|
+
worker = Resque::Worker.all.find(&:working?)
|
|
30
31
|
if worker.nil?
|
|
31
32
|
active_worker = 0
|
|
32
|
-
logger.info(
|
|
33
|
-
break
|
|
34
|
-
end
|
|
35
|
-
if report
|
|
33
|
+
logger.info('All workers are idle')
|
|
36
34
|
break
|
|
37
35
|
end
|
|
36
|
+
|
|
37
|
+
break if report
|
|
38
|
+
|
|
38
39
|
logger.info("Found worker: #{worker}, sleeping for 60 seconds.")
|
|
39
40
|
sleep 60
|
|
40
41
|
end
|
data/bin/bosh-director-migrate
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
5
|
-
require
|
|
6
|
-
require
|
|
3
|
+
require 'logger'
|
|
4
|
+
require 'sequel'
|
|
5
|
+
require 'bosh/director'
|
|
6
|
+
require 'optparse'
|
|
7
7
|
|
|
8
8
|
config_file = nil
|
|
9
9
|
|
|
10
|
-
opts = OptionParser.new do |
|
|
11
|
-
|
|
10
|
+
opts = OptionParser.new do |op|
|
|
11
|
+
op.on('-c', '--config FILE', 'configuration file') do |opt|
|
|
12
12
|
config_file = opt
|
|
13
13
|
end
|
|
14
14
|
end
|
|
@@ -21,11 +21,11 @@ if config_file.nil?
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
config = Psych.load_file(config_file)
|
|
24
|
-
unless config[
|
|
25
|
-
abort (
|
|
24
|
+
unless config['db'] && config['db']['database']
|
|
25
|
+
abort ('Director database config missing from config file')
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
-
db = Bosh::Director::Config.configure_db(config[
|
|
28
|
+
db = Bosh::Director::Config.configure_db(config['db'])
|
|
29
29
|
|
|
30
30
|
def migrate(database, schema_table, dir, target = nil)
|
|
31
31
|
options = {}
|
|
@@ -36,21 +36,20 @@ def migrate(database, schema_table, dir, target = nil)
|
|
|
36
36
|
Sequel::TimestampMigrator.new(database, dir, options).run
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
migrations_dir = File.expand_path(
|
|
39
|
+
migrations_dir = File.expand_path('../../db/migrations/director', __FILE__)
|
|
40
40
|
|
|
41
41
|
migrate(db, nil, migrations_dir)
|
|
42
42
|
|
|
43
|
-
if config[
|
|
44
|
-
dns_migrations_dir = File.expand_path(
|
|
45
|
-
dns_db = Bosh::Director::Config.configure_db(config[
|
|
46
|
-
migrate(dns_db,
|
|
47
|
-
dns_migrations_dir)
|
|
43
|
+
if config['dns'] && config['dns']['db']
|
|
44
|
+
dns_migrations_dir = File.expand_path('../../db/migrations/dns', __FILE__)
|
|
45
|
+
dns_db = Bosh::Director::Config.configure_db(config['dns']['db'])
|
|
46
|
+
migrate(dns_db, 'dns_schema', dns_migrations_dir)
|
|
48
47
|
end
|
|
49
48
|
|
|
50
|
-
cpi = config[
|
|
51
|
-
require_path = File.join(
|
|
49
|
+
cpi = config['cloud']['plugin']
|
|
50
|
+
require_path = File.join('cloud', cpi)
|
|
52
51
|
cpi_path = $LOAD_PATH.find { |p| File.exist?(File.join(p, require_path)) }
|
|
53
|
-
migrations = File.expand_path(
|
|
52
|
+
migrations = File.expand_path('../db/migrations', cpi_path)
|
|
54
53
|
|
|
55
54
|
if File.directory?(migrations)
|
|
56
55
|
migrate(db, "#{cpi}_cpi_schema", migrations)
|
data/bin/bosh-director-scheduler
CHANGED
|
@@ -5,8 +5,8 @@ require 'bosh/director/scheduler'
|
|
|
5
5
|
|
|
6
6
|
config_file = ::File.expand_path('../../config/bosh-director.yml', __FILE__)
|
|
7
7
|
|
|
8
|
-
opts = OptionParser.new do |
|
|
9
|
-
|
|
8
|
+
opts = OptionParser.new do |op|
|
|
9
|
+
op.on('-c', '--config [ARG]', 'Configuration File') do |opt|
|
|
10
10
|
config_file = opt
|
|
11
11
|
end
|
|
12
12
|
end
|
data/bin/bosh-director-worker
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
3
|
+
require 'erb'
|
|
4
|
+
require 'bosh/director'
|
|
5
5
|
|
|
6
6
|
config_file = nil
|
|
7
7
|
index = nil
|
|
8
8
|
erb = false
|
|
9
9
|
|
|
10
|
-
opts = OptionParser.new do |
|
|
11
|
-
|
|
10
|
+
opts = OptionParser.new do |op|
|
|
11
|
+
op.on('-c', '--config [ARG]', 'Configuration File') do |opt|
|
|
12
12
|
config_file = opt
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
op.on('-i', '--index [ARG]', Integer, 'Worker Index') do |opt|
|
|
16
16
|
index = opt
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
op.on('-e', '--[no-]erb', 'Treat Configuration as ERB Template') do |opt|
|
|
20
20
|
erb = opt
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
opts.parse!(ARGV.dup)
|
|
25
25
|
|
|
26
|
-
config_file ||= ::File.expand_path(
|
|
26
|
+
config_file ||= ::File.expand_path('../../config/bosh-director.yml', __FILE__)
|
|
27
27
|
config = nil
|
|
28
28
|
|
|
29
29
|
# Is this code even used anymore?
|
|
@@ -40,7 +40,7 @@ if erb
|
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
42
|
|
|
43
|
-
template = ERB.new(File.read(config_file), 0,
|
|
43
|
+
template = ERB.new(File.read(config_file), 0, '%<>-')
|
|
44
44
|
contents = template.result(ConfigBindingHelper.new(index).get_binding)
|
|
45
45
|
config_hash = Psych.load(contents)
|
|
46
46
|
config = Bosh::Director::Config.load_hash(config_hash)
|
|
@@ -63,11 +63,11 @@ begin
|
|
|
63
63
|
worker = Resque::Worker.new(*queues)
|
|
64
64
|
worker.term_child = true
|
|
65
65
|
rescue Resque::NoQueueError
|
|
66
|
-
abort
|
|
66
|
+
abort 'set QUEUE env var, e.g. $ QUEUE=critical,high rake resque:work'
|
|
67
67
|
end
|
|
68
68
|
|
|
69
69
|
Resque.after_fork do
|
|
70
|
-
EM.error_handler{ |e| puts "Error raised during event loop: #{e.message}" }
|
|
70
|
+
EM.error_handler { |e| puts "Error raised during event loop: #{e.message}" }
|
|
71
71
|
Thread.new { EM.run }
|
|
72
72
|
end
|
|
73
73
|
|
data/lib/cloud/dummy.rb
CHANGED
|
@@ -8,12 +8,12 @@ module Bosh
|
|
|
8
8
|
class NotImplemented < StandardError; end
|
|
9
9
|
|
|
10
10
|
def initialize(options)
|
|
11
|
-
if options[
|
|
12
|
-
raise ArgumentError,
|
|
11
|
+
if options['dir'].nil?
|
|
12
|
+
raise ArgumentError, 'please provide base directory for dummy cloud'
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
@options = options
|
|
16
|
-
@base_dir = options[
|
|
16
|
+
@base_dir = options['dir']
|
|
17
17
|
|
|
18
18
|
FileUtils.mkdir_p(@base_dir)
|
|
19
19
|
rescue Errno::EACCES
|
|
@@ -30,64 +30,44 @@ module Bosh
|
|
|
30
30
|
FileUtils.rm(stemcell_file(stemcell_cid))
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
@options['agent']['blobstore']
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def nats_uri
|
|
38
|
-
@options['nats']
|
|
39
|
-
end
|
|
40
|
-
|
|
33
|
+
# rubocop:disable ParameterLists
|
|
41
34
|
def create_vm(agent_id, stemcell, resource_pool, networks, disk_locality = nil, env = nil)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
root_dir = File.join(agent_base_dir, 'root_dir')
|
|
35
|
+
# rubocop:enable ParameterLists
|
|
36
|
+
root_dir = File.join(agent_base_dir(agent_id), 'root_dir')
|
|
45
37
|
FileUtils.mkdir_p(File.join(root_dir, 'etc', 'logrotate.d'))
|
|
46
38
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
39
|
+
write_agent_settings(agent_id, {
|
|
40
|
+
agent_id: agent_id,
|
|
41
|
+
blobstore: @options['agent']['blobstore'],
|
|
42
|
+
ntp: [],
|
|
43
|
+
disks: { persistent: {} },
|
|
44
|
+
vm: { name: "vm-#{agent_id}" },
|
|
45
|
+
mbus: @options['nats'],
|
|
46
|
+
})
|
|
54
47
|
|
|
48
|
+
agent_cmd = agent_cmd(agent_id, root_dir, :ruby)
|
|
49
|
+
agent_log = "#{@options['dir']}/agent.#{agent_id}.log"
|
|
50
|
+
agent_pid = Process.spawn(*agent_cmd, chdir: agent_base_dir(agent_id), out: agent_log, err: agent_log)
|
|
55
51
|
Process.detach(agent_pid)
|
|
56
52
|
|
|
57
|
-
FileUtils.mkdir_p(File.join(@base_dir,
|
|
58
|
-
|
|
53
|
+
FileUtils.mkdir_p(File.join(@base_dir, 'running_vms'))
|
|
54
|
+
File.write(vm_file(agent_pid), agent_id)
|
|
59
55
|
|
|
60
56
|
agent_pid.to_s
|
|
61
57
|
end
|
|
62
58
|
|
|
63
|
-
def write_agent_settings(agent_base_dir, agent_id, nats_uri)
|
|
64
|
-
FileUtils.mkdir_p(File.join(agent_base_dir, 'bosh'))
|
|
65
|
-
settings = {
|
|
66
|
-
agent_id: agent_id,
|
|
67
|
-
blobstore: @options['agent']['blobstore'],
|
|
68
|
-
ntp: [],
|
|
69
|
-
disks: {
|
|
70
|
-
persistent: {},
|
|
71
|
-
},
|
|
72
|
-
vm: {
|
|
73
|
-
name: "vm-#{agent_id}"
|
|
74
|
-
},
|
|
75
|
-
mbus: nats_uri,
|
|
76
|
-
}
|
|
77
|
-
File.write(File.join(agent_base_dir, 'bosh', 'settings.json'), JSON.generate(settings))
|
|
78
|
-
end
|
|
79
|
-
|
|
80
59
|
def delete_vm(vm_name)
|
|
81
60
|
agent_pid = vm_name.to_i
|
|
82
|
-
Process.kill(
|
|
61
|
+
Process.kill('INT', agent_pid)
|
|
62
|
+
# rubocop:disable HandleExceptions
|
|
83
63
|
rescue Errno::ESRCH
|
|
84
|
-
|
|
64
|
+
# rubocop:enable HandleExceptions
|
|
85
65
|
ensure
|
|
86
|
-
FileUtils.rm_rf(File.join(@base_dir,
|
|
66
|
+
FileUtils.rm_rf(File.join(@base_dir, 'running_vms', vm_name))
|
|
87
67
|
end
|
|
88
68
|
|
|
89
69
|
def reboot_vm(vm)
|
|
90
|
-
raise NotImplemented,
|
|
70
|
+
raise NotImplemented, 'Dummy CPI does not implement reboot_vm'
|
|
91
71
|
end
|
|
92
72
|
|
|
93
73
|
def has_vm?(vm_id)
|
|
@@ -95,17 +75,27 @@ module Bosh
|
|
|
95
75
|
end
|
|
96
76
|
|
|
97
77
|
def configure_networks(vm, networks)
|
|
98
|
-
raise NotImplemented,
|
|
78
|
+
raise NotImplemented, 'Dummy CPI does not implement configure_networks'
|
|
99
79
|
end
|
|
100
80
|
|
|
101
81
|
def attach_disk(vm_id, disk_id)
|
|
102
82
|
file = attachment_file(vm_id, disk_id)
|
|
103
83
|
FileUtils.mkdir_p(File.dirname(file))
|
|
104
84
|
FileUtils.touch(file)
|
|
85
|
+
|
|
86
|
+
agent_id = agent_id_for_vm_id(vm_id)
|
|
87
|
+
settings = read_agent_settings(agent_id)
|
|
88
|
+
settings['disks']['persistent'][disk_id] = 'attached'
|
|
89
|
+
write_agent_settings(agent_id, settings)
|
|
105
90
|
end
|
|
106
91
|
|
|
107
92
|
def detach_disk(vm_id, disk_id)
|
|
108
93
|
FileUtils.rm(attachment_file(vm_id, disk_id))
|
|
94
|
+
|
|
95
|
+
agent_id = agent_id_for_vm_id(vm_id)
|
|
96
|
+
settings = read_agent_settings(agent_id)
|
|
97
|
+
settings['disks']['persistent'].delete(disk_id)
|
|
98
|
+
write_agent_settings(agent_id, settings)
|
|
109
99
|
end
|
|
110
100
|
|
|
111
101
|
def create_disk(size, vm_locality = nil)
|
|
@@ -133,29 +123,58 @@ module Bosh
|
|
|
133
123
|
end
|
|
134
124
|
|
|
135
125
|
def validate_deployment(old_manifest, new_manifest)
|
|
136
|
-
raise NotImplemented,
|
|
126
|
+
raise NotImplemented, 'Dummy CPI does not implement validate_deployment'
|
|
137
127
|
end
|
|
138
128
|
|
|
139
129
|
private
|
|
140
130
|
|
|
131
|
+
def agent_id_for_vm_id(vm_id)
|
|
132
|
+
File.read(vm_file(vm_id))
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def agent_settings_file(agent_id)
|
|
136
|
+
File.join(agent_base_dir(agent_id), 'bosh', 'settings.json')
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def agent_base_dir(agent_id)
|
|
140
|
+
"#{@options['dir']}/agent-base-dir-#{agent_id}"
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
def write_agent_settings(agent_id, settings)
|
|
144
|
+
FileUtils.mkdir_p(File.dirname(agent_settings_file(agent_id)))
|
|
145
|
+
File.write(agent_settings_file(agent_id), JSON.generate(settings))
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
def agent_cmd(agent_id, root_dir, agent_type)
|
|
149
|
+
go_agent_exe = File.absolute_path('bosh/go_agent/out/bosh-agent')
|
|
150
|
+
{
|
|
151
|
+
ruby: %W[bosh_agent -b #{agent_base_dir(agent_id)} -I dummy -r #{root_dir} --no-alerts],
|
|
152
|
+
go: %W[#{go_agent_exe} -b #{agent_base_dir(agent_id)} -I dummy -P dummy -M dummy],
|
|
153
|
+
}[agent_type]
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
def read_agent_settings(agent_id)
|
|
157
|
+
JSON.parse(File.read(agent_settings_file(agent_id)))
|
|
158
|
+
end
|
|
159
|
+
|
|
141
160
|
def stemcell_file(stemcell_id)
|
|
142
161
|
File.join(@base_dir, "stemcell_#{stemcell_id}")
|
|
143
162
|
end
|
|
144
163
|
|
|
145
164
|
def vm_file(vm_id)
|
|
146
|
-
File.join(@base_dir,
|
|
165
|
+
File.join(@base_dir, 'running_vms', vm_id.to_s)
|
|
147
166
|
end
|
|
148
167
|
|
|
149
168
|
def disk_file(disk_id)
|
|
150
|
-
File.join(@base_dir,
|
|
169
|
+
File.join(@base_dir, 'disks', disk_id)
|
|
151
170
|
end
|
|
152
171
|
|
|
153
172
|
def attachment_file(vm_id, disk_id)
|
|
154
|
-
File.join(@base_dir,
|
|
173
|
+
File.join(@base_dir, 'attachments', vm_id, disk_id)
|
|
155
174
|
end
|
|
156
175
|
|
|
157
176
|
def snapshot_file(snapshot_id)
|
|
158
|
-
File.join(@base_dir,
|
|
177
|
+
File.join(@base_dir, 'snapshots', snapshot_id)
|
|
159
178
|
end
|
|
160
179
|
end
|
|
161
180
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bosh-director
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.1777.0
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2014-01-
|
|
12
|
+
date: 2014-01-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bcrypt-ruby
|
|
@@ -34,7 +34,7 @@ dependencies:
|
|
|
34
34
|
requirements:
|
|
35
35
|
- - ~>
|
|
36
36
|
- !ruby/object:Gem::Version
|
|
37
|
-
version: 1.
|
|
37
|
+
version: 1.1777.0
|
|
38
38
|
type: :runtime
|
|
39
39
|
prerelease: false
|
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -42,7 +42,7 @@ dependencies:
|
|
|
42
42
|
requirements:
|
|
43
43
|
- - ~>
|
|
44
44
|
- !ruby/object:Gem::Version
|
|
45
|
-
version: 1.
|
|
45
|
+
version: 1.1777.0
|
|
46
46
|
- !ruby/object:Gem::Dependency
|
|
47
47
|
name: bosh-core
|
|
48
48
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -50,7 +50,7 @@ dependencies:
|
|
|
50
50
|
requirements:
|
|
51
51
|
- - ~>
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: 1.
|
|
53
|
+
version: 1.1777.0
|
|
54
54
|
type: :runtime
|
|
55
55
|
prerelease: false
|
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -58,7 +58,7 @@ dependencies:
|
|
|
58
58
|
requirements:
|
|
59
59
|
- - ~>
|
|
60
60
|
- !ruby/object:Gem::Version
|
|
61
|
-
version: 1.
|
|
61
|
+
version: 1.1777.0
|
|
62
62
|
- !ruby/object:Gem::Dependency
|
|
63
63
|
name: bosh_common
|
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,7 +66,7 @@ dependencies:
|
|
|
66
66
|
requirements:
|
|
67
67
|
- - ~>
|
|
68
68
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: 1.
|
|
69
|
+
version: 1.1777.0
|
|
70
70
|
type: :runtime
|
|
71
71
|
prerelease: false
|
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -74,7 +74,7 @@ dependencies:
|
|
|
74
74
|
requirements:
|
|
75
75
|
- - ~>
|
|
76
76
|
- !ruby/object:Gem::Version
|
|
77
|
-
version: 1.
|
|
77
|
+
version: 1.1777.0
|
|
78
78
|
- !ruby/object:Gem::Dependency
|
|
79
79
|
name: bosh_cpi
|
|
80
80
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -82,7 +82,7 @@ dependencies:
|
|
|
82
82
|
requirements:
|
|
83
83
|
- - ~>
|
|
84
84
|
- !ruby/object:Gem::Version
|
|
85
|
-
version: 1.
|
|
85
|
+
version: 1.1777.0
|
|
86
86
|
type: :runtime
|
|
87
87
|
prerelease: false
|
|
88
88
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -90,7 +90,7 @@ dependencies:
|
|
|
90
90
|
requirements:
|
|
91
91
|
- - ~>
|
|
92
92
|
- !ruby/object:Gem::Version
|
|
93
|
-
version: 1.
|
|
93
|
+
version: 1.1777.0
|
|
94
94
|
- !ruby/object:Gem::Dependency
|
|
95
95
|
name: bosh_openstack_cpi
|
|
96
96
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -98,7 +98,7 @@ dependencies:
|
|
|
98
98
|
requirements:
|
|
99
99
|
- - ~>
|
|
100
100
|
- !ruby/object:Gem::Version
|
|
101
|
-
version: 1.
|
|
101
|
+
version: 1.1777.0
|
|
102
102
|
type: :runtime
|
|
103
103
|
prerelease: false
|
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -106,7 +106,7 @@ dependencies:
|
|
|
106
106
|
requirements:
|
|
107
107
|
- - ~>
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
|
-
version: 1.
|
|
109
|
+
version: 1.1777.0
|
|
110
110
|
- !ruby/object:Gem::Dependency
|
|
111
111
|
name: bosh_aws_cpi
|
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -114,7 +114,7 @@ dependencies:
|
|
|
114
114
|
requirements:
|
|
115
115
|
- - ~>
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: 1.
|
|
117
|
+
version: 1.1777.0
|
|
118
118
|
type: :runtime
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -122,7 +122,7 @@ dependencies:
|
|
|
122
122
|
requirements:
|
|
123
123
|
- - ~>
|
|
124
124
|
- !ruby/object:Gem::Version
|
|
125
|
-
version: 1.
|
|
125
|
+
version: 1.1777.0
|
|
126
126
|
- !ruby/object:Gem::Dependency
|
|
127
127
|
name: bosh_vsphere_cpi
|
|
128
128
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -130,7 +130,7 @@ dependencies:
|
|
|
130
130
|
requirements:
|
|
131
131
|
- - ~>
|
|
132
132
|
- !ruby/object:Gem::Version
|
|
133
|
-
version: 1.
|
|
133
|
+
version: 1.1777.0
|
|
134
134
|
type: :runtime
|
|
135
135
|
prerelease: false
|
|
136
136
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -138,7 +138,7 @@ dependencies:
|
|
|
138
138
|
requirements:
|
|
139
139
|
- - ~>
|
|
140
140
|
- !ruby/object:Gem::Version
|
|
141
|
-
version: 1.
|
|
141
|
+
version: 1.1777.0
|
|
142
142
|
- !ruby/object:Gem::Dependency
|
|
143
143
|
name: eventmachine
|
|
144
144
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -461,7 +461,7 @@ dependencies:
|
|
|
461
461
|
version: '1.0'
|
|
462
462
|
description: ! 'BOSH Director
|
|
463
463
|
|
|
464
|
-
|
|
464
|
+
0308a9'
|
|
465
465
|
email: support@cloudfoundry.com
|
|
466
466
|
executables:
|
|
467
467
|
- bosh-director
|
|
@@ -713,7 +713,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
713
713
|
version: '0'
|
|
714
714
|
segments:
|
|
715
715
|
- 0
|
|
716
|
-
hash:
|
|
716
|
+
hash: -2902799239834298514
|
|
717
717
|
requirements: []
|
|
718
718
|
rubyforge_project:
|
|
719
719
|
rubygems_version: 1.8.23
|