Merge lp:~cgb-cs/appscale/tools-cloud-as-xen-support into lp:appscale/trunk-tools

Proposed by Chris Bunch
Status: Rejected
Rejected by: Navraj Chohan
Proposed branch: lp:~cgb-cs/appscale/tools-cloud-as-xen-support
Merge into: lp:appscale/trunk-tools
Diff against target: 105 lines (+50/-16)
2 files modified
bin/appscale-add-keypair (+29/-8)
lib/vm_tools.rb (+21/-8)
To merge this branch: bzr merge lp:~cgb-cs/appscale/tools-cloud-as-xen-support
Reviewer Review Type Date Requested Status
Navraj Chohan (community) Disapprove
Review via email: mp+77361@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Navraj Chohan (nchohan) :
review: Disapprove

Unmerged revisions

277. By Chris Bunch

changed tools to accept public and private ips given by the user, so that they can utilize ec2/euca boxes for xen-style deployments

276. By Navraj Chohan

merged with java blobstore app

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/appscale-add-keypair'
2--- bin/appscale-add-keypair 2010-12-24 23:33:40 +0000
3+++ bin/appscale-add-keypair 2011-09-28 16:25:23 +0000
4@@ -83,19 +83,33 @@
5 copy_success = true
6
7 ips.each { |ip|
8- puts "\n\n"
9- puts "Executing ssh-copy-id for host : " + ip
10+ # Users can utilize boxes with public and private IPs for Xen-like
11+ # deployments by specifying public ip / private ip. If they have
12+ # specified both IPs, only use the public ip.
13+
14+ public_ip = ip
15+ private_ip = ip
16+
17+ if ip.include?("/")
18+ public_ip, private_ip = ip.split("/")
19+ end
20+
21+ public_ip.strip!
22+ private_ip.strip!
23+
24+ puts "\n\n"
25+ puts "Executing ssh-copy-id for host : " + public_ip
26 puts "------------------------------"
27
28 if auto
29- puts CommonFunctions.shell("#{expect_script} root@#{ip} #{path} #{password}")
30+ puts CommonFunctions.shell("#{expect_script} root@#{public_ip} #{path} #{password}")
31 else
32- puts CommonFunctions.shell("ssh-copy-id -i #{path} root@#{ip}")
33+ puts CommonFunctions.shell("ssh-copy-id -i #{path} root@#{public_ip}")
34 end
35-
36- #Checking the exit status of the above shell command
37+
38+ # Checking the exit status of the above shell command
39 if $?.to_i != 0
40- puts "\n\nERROR ! Unable to ssh-copy-id to host : "+ip
41+ puts "\n\nERROR ! Unable to ssh-copy-id to host : " + public_ip
42 puts "\nTerminating script"
43 copy_success = false
44 break
45@@ -104,11 +118,18 @@
46
47 if copy_success
48 head_ip = node_layout.head_node.id
49+
50+ if head_ip.include?("/")
51+ head_ip, _ = head_ip.split("/")
52+ head_ip.strip!
53+ end
54+
55 puts CommonFunctions.shell("scp -i #{path} #{path} root@#{head_ip}:.ssh/id_rsa")
56 # this is needed for EC2 integration.
57 puts CommonFunctions.shell("scp -i #{path} #{path} root@#{head_ip}:.ssh/id_dsa")
58 puts CommonFunctions.shell("scp -i #{path} #{pub_key} root@#{head_ip}:.ssh/id_rsa.pub")
59-
60+
61 FileUtils.cp(path, backup_key)
62 puts "A new ssh key has been generated for you and placed at #{path}. You can now use this key to log into any of the machines you specified without providing a password via the following command:\n\tssh root@XXX.XXX.XXX.XXX -i #{path}"
63 end
64+
65
66=== modified file 'lib/vm_tools.rb'
67--- lib/vm_tools.rb 2011-07-27 21:13:07 +0000
68+++ lib/vm_tools.rb 2011-09-28 16:25:23 +0000
69@@ -309,15 +309,28 @@
70 locations = locations.flatten.to_s
71 return locations
72 end
73+
74+ def self.spawn_head_node_via_vmm(node, keyname, head_node_jobs)
75+ # We don't care about the instance's ID if not using cloud-tools
76+
77+ # If deploying over locally managed Xen boxes, public ip = private ip
78+ # Otherwise, the user has to give us the public and private IPs
79+
80+ public_ip = node.id
81+ private_ip = node.id
82+
83+ if node.id.include?("/")
84+ public_ip, private_ip = node.id.split("/")
85+ end
86+
87+ public_ip.strip!
88+ private_ip.strip!
89+
90+ head_node = "#{public_ip}:#{private_ip}:#{head_node_jobs}:i-ZFOOBARZ:cloud1"
91+ locations = [head_node].flatten.to_s
92+ return locations
93+ end
94
95- def self.spawn_head_node_via_vmm(node, keyname, head_node_jobs)
96- # We don't care about the instance's ID if not using cloud-tools
97- # and for Xen, public ip = private ip
98- head_node = "#{node.id}:#{node.id}:#{head_node_jobs}:i-ZFOOBARZ:cloud1"
99- locations = [head_node].flatten.to_s
100- return locations
101- end
102-
103 def self.get_cloud_creds(node_layout)
104 cloud_creds = {
105 "machine" => "#{MACHINE}",

Subscribers

People subscribed via source and target branches