Skip to content

Instantly share code, notes, and snippets.

@killfill
Created August 20, 2014 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save killfill/a1da32ce6cea797fb653 to your computer and use it in GitHub Desktop.
Save killfill/a1da32ce6cea797fb653 to your computer and use it in GitHub Desktop.
diff --git a/bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager.rb b/bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager.rb
index dcc578a..0b07db1 100644
--- a/bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager.rb
+++ b/bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager.rb
@@ -133,9 +133,10 @@ module Bosh::Deployer
end
end
- step 'Updating persistent disk' do
- update_persistent_disk
- end
+ #What if we dont want to do the persistent disk stuff, or dont want to go throught the update process
+ # step 'Updating persistent disk' do
+ # update_persistent_disk
+ # end
unless @apply_spec
step 'Fetching apply spec' do
diff --git a/bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/openstack.rb b/bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/openstack.rb
index e398846..a9fa19b 100644
--- a/bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/openstack.rb
+++ b/bosh_cli_plugin_micro/lib/bosh/deployer/instance_manager/openstack.rb
@@ -25,7 +25,9 @@ module Bosh::Deployer
end
def remote_tunnel
- @remote_tunnel.create(instance_manager.client_services_ip, registry.port)
+ #No idea why on openstack a tunnel must be made. (security groups?)
+ #Lets just not do it this time.. it tries to ssh with vcap user
+ #@remote_tunnel.create(instance_manager.client_services_ip, registry.port)
end
def disk_model
@@ -109,9 +111,14 @@ module Bosh::Deployer
def discover_client_services_ip
if instance_manager.state.vm_cid
- server = instance_manager.cloud.openstack.servers.get(instance_manager.state.vm_cid)
- ip = server.floating_ip_address || server.private_ip_address
+ #This is actually a FOG call. Lets call the external_cpi instead...
+ #server = instance_manager.cloud.openstack.servers.get(instance_manager.state.vm_cid)
+ #ip = server.floating_ip_address || server.private_ip_address
+
+ server = instance_manager.cloud.get_vm(instance_manager.state.vm_cid)
+ ip = server['floating_ip_address'] || server['private_ip_address']
+
logger.info("discovered bosh ip=#{ip}")
ip
@@ -124,9 +131,14 @@ module Bosh::Deployer
def discover_agent_services_ip
if instance_manager.state.vm_cid
- server = instance_manager.cloud.openstack.servers.get(instance_manager.state.vm_cid)
- ip = server.private_ip_address
+ #This is actually a FOG call. Lets call the external_cpi instead...
+ #server = instance_manager.cloud.openstack.servers.get(instance_manager.state.vm_cid)
+ #ip = server.private_ip_address
+
+ server = instance_manager.cloud.get_vm(instance_manager.state.vm_cid)
+ ip = server['private_ip_address']
+
logger.info("discovered bosh ip=#{ip}")
ip
diff --git a/bosh_cpi/lib/cloud/external_cpi.rb b/bosh_cpi/lib/cloud/external_cpi.rb
index e754b10..9f57598 100644
--- a/bosh_cpi/lib/cloud/external_cpi.rb
+++ b/bosh_cpi/lib/cloud/external_cpi.rb
@@ -26,6 +26,7 @@ module Bosh::Clouds
Bosh::Clouds::VMCreationFailed
).freeze
+ #Adding get_vm, so we can use external_cpi instead of fog (openstack.rb:117) to get the ip of the created machine
KNOWN_RPC_METHODS = %w(
current_vm_id
create_stemcell
@@ -33,6 +34,7 @@ module Bosh::Clouds
create_vm
delete_vm
has_vm?
+ get_vm
reboot_vm
set_vm_metadata
configure_networks
@@ -125,9 +127,11 @@ module Bosh::Clouds
def save_cpi_log(output)
# cpi log path is set up at the beginning of every task in Config
# see JobRunner#setup_task_logging
- File.open(Config.cpi_task_log, 'a') do |f|
- f.write(output)
- end
+ File.open('/tmp/bosh_cpi.log', 'a') { |f| f.write(output) }
+ # ERROR: undefined method `cpi_task_log'
+ # File.open(Config.cpi_task_log, 'a') do |f|
+ # f.write(output)
+ # end
end
def parsed_response(input)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment