opennebula-cli 4.14.0 → 4.14.2
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.
- checksums.yaml +4 -4
- data/bin/onevcenter +1 -0
- data/bin/onevm +8 -2
- data/lib/one_helper.rb +31 -24
- data/lib/one_helper/onehost_helper.rb +1 -1
- data/lib/one_helper/onetemplate_helper.rb +11 -2
- data/lib/one_helper/onevm_helper.rb +41 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c8b0d34aa27f09011a52b0ac589242fdbc8c497
|
4
|
+
data.tar.gz: e798b9a08d35fa05ebf9637a35fa0ccfff817be2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38bf76e873ef7b2722e4bbcaaa5cca317a14010aac0f1eba7345c3cc2d644a80377d419b5d45ba9adce8c4b70520551c63339d62dd6c8dcb001a4625c2c8486b
|
7
|
+
data.tar.gz: 9983b5712e6a5c975b32b4b9e8db3a68c30699afa6336e4b191c7f3a2289ce1181cc181ad317c47a4f41ddce2c627c4730aea0f4192f214683c9f91675b7f612
|
data/bin/onevcenter
CHANGED
@@ -273,6 +273,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
|
273
273
|
" - Name : #{n[:name]}\n"\
|
274
274
|
" - Type : #{n[:type]}\n"
|
275
275
|
print_str += " - VLAN ID : #{n[:vlan]}\n" if n[:vlan]
|
276
|
+
print_str += " - Cluster : #{n[:cluster]}\n"
|
276
277
|
print_str += " Import this Network [y/n]? "
|
277
278
|
|
278
279
|
STDOUT.print print_str
|
data/bin/onevm
CHANGED
@@ -127,6 +127,12 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
|
127
127
|
:description => "ID of the Snapshot to save."
|
128
128
|
}
|
129
129
|
|
130
|
+
PERSISTENT={
|
131
|
+
:name => "persistent",
|
132
|
+
:large => "--persistent",
|
133
|
+
:description => "Make the new images persistent"
|
134
|
+
}
|
135
|
+
|
130
136
|
########################################################################
|
131
137
|
# Global Options
|
132
138
|
########################################################################
|
@@ -916,9 +922,9 @@ cmd=CommandParser::CmdParser.new(ARGV) do
|
|
916
922
|
States: POWEROFF
|
917
923
|
EOT
|
918
924
|
|
919
|
-
command :save, save_desc, :vmid, :name do
|
925
|
+
command :save, save_desc, :vmid, :name, :options=>[PERSISTENT] do
|
920
926
|
helper.perform_action(args[0],options,"Saving VM") do |vm|
|
921
|
-
res = vm.save_as_template(args[1])
|
927
|
+
res = vm.save_as_template(args[1], options[:persistent] )
|
922
928
|
|
923
929
|
if !OpenNebula.is_error?(res)
|
924
930
|
puts "Template ID: #{res}"
|
data/lib/one_helper.rb
CHANGED
@@ -828,39 +828,46 @@ EOT
|
|
828
828
|
end
|
829
829
|
|
830
830
|
def OpenNebulaHelper.update_template_helper(append, id, resource, path, xpath, update=true)
|
831
|
-
|
832
|
-
|
831
|
+
if path
|
832
|
+
return File.read(path)
|
833
|
+
elsif append
|
834
|
+
return editor_input()
|
835
|
+
else
|
836
|
+
if update
|
837
|
+
rc = resource.info
|
833
838
|
|
834
|
-
|
835
|
-
|
839
|
+
if OpenNebula.is_error?(rc)
|
840
|
+
puts rc.message
|
841
|
+
exit -1
|
842
|
+
end
|
843
|
+
end
|
836
844
|
|
837
|
-
|
838
|
-
|
839
|
-
|
845
|
+
return editor_input(resource.template_like_str(xpath))
|
846
|
+
end
|
847
|
+
end
|
840
848
|
|
841
|
-
|
842
|
-
|
843
|
-
exit -1
|
844
|
-
end
|
845
|
-
end
|
849
|
+
def OpenNebulaHelper.editor_input(contents=nil)
|
850
|
+
require 'tempfile'
|
846
851
|
|
847
|
-
|
848
|
-
tmp.flush
|
849
|
-
end
|
852
|
+
tmp = Tempfile.new("one_cli")
|
850
853
|
|
851
|
-
|
852
|
-
|
854
|
+
if contents
|
855
|
+
tmp << contents
|
856
|
+
tmp.flush
|
857
|
+
end
|
853
858
|
|
854
|
-
|
855
|
-
|
856
|
-
exit -1
|
857
|
-
end
|
859
|
+
editor_path = ENV["EDITOR"] ? ENV["EDITOR"] : EDITOR_PATH
|
860
|
+
system("#{editor_path} #{tmp.path}")
|
858
861
|
|
859
|
-
|
862
|
+
unless $?.exitstatus == 0
|
863
|
+
puts "Editor not defined"
|
864
|
+
exit -1
|
860
865
|
end
|
861
866
|
|
862
|
-
|
863
|
-
|
867
|
+
tmp.close
|
868
|
+
|
869
|
+
str = File.read(tmp.path)
|
870
|
+
return str
|
864
871
|
end
|
865
872
|
|
866
873
|
def self.parse_user_object(user_object)
|
@@ -433,7 +433,7 @@ class OneHostHelper < OpenNebulaHelper::OneHelper
|
|
433
433
|
CLIHelper.print_header("WILD VIRTUAL MACHINES", false)
|
434
434
|
puts
|
435
435
|
|
436
|
-
format = "
|
436
|
+
format = "%-30.30s %36s %4s %10s"
|
437
437
|
CLIHelper.print_header(format % ["NAME", "IMPORT_ID", "CPU", "MEMORY"],
|
438
438
|
true)
|
439
439
|
|
@@ -15,6 +15,7 @@
|
|
15
15
|
#--------------------------------------------------------------------------- #
|
16
16
|
|
17
17
|
require 'one_helper'
|
18
|
+
require 'base64'
|
18
19
|
|
19
20
|
class OneTemplateHelper < OpenNebulaHelper::OneHelper
|
20
21
|
VM_NAME={
|
@@ -117,7 +118,7 @@ EOT
|
|
117
118
|
|
118
119
|
answers = ""
|
119
120
|
|
120
|
-
puts "There are some parameters that require user input."
|
121
|
+
puts "There are some parameters that require user input. Use the string <<EDITOR>> to launch an editor (e.g. for multi-line inputs)"
|
121
122
|
|
122
123
|
user_inputs.each do |key, val|
|
123
124
|
input_cfg = val.split('|')
|
@@ -136,8 +137,16 @@ EOT
|
|
136
137
|
print " * (#{key}) #{description}: "
|
137
138
|
|
138
139
|
case type
|
139
|
-
when 'text'
|
140
|
+
when 'text', 'text64'
|
140
141
|
answer = STDIN.readline.chop
|
142
|
+
|
143
|
+
if answer == "<<EDITOR>>"
|
144
|
+
answer = OpenNebulaHelper.editor_input()
|
145
|
+
end
|
146
|
+
|
147
|
+
if type == 'text64'
|
148
|
+
answer = Base64::encode64(answer).strip.delete("\n")
|
149
|
+
end
|
141
150
|
when 'password'
|
142
151
|
answer = OpenNebulaHelper::OneHelper.get_password
|
143
152
|
else
|
@@ -701,7 +701,23 @@ in the frontend machine.
|
|
701
701
|
end
|
702
702
|
end
|
703
703
|
|
704
|
-
|
704
|
+
# This variable holds the extra IP's got from monitoring. Right
|
705
|
+
# now it adds GUEST_IP and GUEST_IP_ADDRESSES from vcenter
|
706
|
+
# monitoring. If other variables hold IPs just add them to this
|
707
|
+
# array. Duplicate IPs are not shown.
|
708
|
+
extra_ips = []
|
709
|
+
|
710
|
+
if val=vm["/VM/MONITORING/GUEST_IP"]
|
711
|
+
extra_ips << val if val && !val.empty?
|
712
|
+
end
|
713
|
+
|
714
|
+
if val=vm["/VM/MONITORING/GUEST_IP_ADDRESSES"]
|
715
|
+
extra_ips += val.split(',') if val && !val.empty?
|
716
|
+
end
|
717
|
+
|
718
|
+
extra_ips.uniq!
|
719
|
+
|
720
|
+
if vm.has_elements?("/VM/TEMPLATE/NIC") || !extra_ips.empty?
|
705
721
|
puts
|
706
722
|
CLIHelper.print_header(str_h1 % "VM NICS",false)
|
707
723
|
|
@@ -711,13 +727,17 @@ in the frontend machine.
|
|
711
727
|
"VLAN"=>"no",
|
712
728
|
"BRIDGE"=>"-"}
|
713
729
|
|
730
|
+
shown_ips = []
|
731
|
+
|
714
732
|
array_id = 0
|
715
|
-
vm_nics = [vm.to_hash['VM']['TEMPLATE']['NIC']].flatten
|
733
|
+
vm_nics = [vm.to_hash['VM']['TEMPLATE']['NIC']].flatten.compact
|
716
734
|
vm_nics.each {|nic|
|
717
735
|
|
718
736
|
next if nic.has_key?("CLI_DONE")
|
719
737
|
|
720
738
|
if nic.has_key?("IP6_LINK")
|
739
|
+
shown_ips << nic["IP6_LINK"]
|
740
|
+
|
721
741
|
ip6_link = {"IP" => nic.delete("IP6_LINK"),
|
722
742
|
"CLI_DONE" => true,
|
723
743
|
"DOUBLE_ENTRY" => true}
|
@@ -727,6 +747,8 @@ in the frontend machine.
|
|
727
747
|
end
|
728
748
|
|
729
749
|
if nic.has_key?("IP6_ULA")
|
750
|
+
shown_ips << nic["IP6_ULA"]
|
751
|
+
|
730
752
|
ip6_link = {"IP" => nic.delete("IP6_ULA"),
|
731
753
|
"CLI_DONE" => true,
|
732
754
|
"DOUBLE_ENTRY" => true}
|
@@ -736,6 +758,8 @@ in the frontend machine.
|
|
736
758
|
end
|
737
759
|
|
738
760
|
if nic.has_key?("IP6_GLOBAL")
|
761
|
+
shown_ips << nic["IP6_GLOBAL"]
|
762
|
+
|
739
763
|
ip6_link = {"IP" => nic.delete("IP6_GLOBAL"),
|
740
764
|
"CLI_DONE" => true,
|
741
765
|
"DOUBLE_ENTRY" => true}
|
@@ -744,10 +768,25 @@ in the frontend machine.
|
|
744
768
|
array_id += 1
|
745
769
|
end
|
746
770
|
|
771
|
+
shown_ips << nic["IP"] if nic.has_key?("IP")
|
772
|
+
|
747
773
|
nic.merge!(nic_default) {|k,v1,v2| v1}
|
748
774
|
array_id += 1
|
749
775
|
}
|
750
776
|
|
777
|
+
extra_ips -= shown_ips
|
778
|
+
|
779
|
+
# Add extra IPs to the VM NICS table
|
780
|
+
extra_ips.each do |ip|
|
781
|
+
vm_nics << {
|
782
|
+
"NIC_ID" => "-",
|
783
|
+
"IP" => ip,
|
784
|
+
"NETWORK" => "Additional IP",
|
785
|
+
"BRIDGE" => "-",
|
786
|
+
"VLAN" => "-"
|
787
|
+
}
|
788
|
+
end
|
789
|
+
|
751
790
|
CLIHelper::ShowTable.new(nil, self) do
|
752
791
|
column :ID, "", :size=>3 do |d|
|
753
792
|
if d["DOUBLE_ENTRY"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opennebula-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.14.
|
4
|
+
version: 4.14.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenNebula
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opennebula
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.14.
|
19
|
+
version: 4.14.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.14.
|
26
|
+
version: 4.14.2
|
27
27
|
description: Commands used to talk to OpenNebula
|
28
28
|
email: contact@opennebula.org
|
29
29
|
executables:
|
@@ -34,17 +34,17 @@ executables:
|
|
34
34
|
- oneflow
|
35
35
|
- oneflow-template
|
36
36
|
- onegroup
|
37
|
-
- onehost
|
38
37
|
- oneimage
|
39
38
|
- onesecgroup
|
40
39
|
- oneshowback
|
41
40
|
- onetemplate
|
42
41
|
- oneuser
|
43
|
-
- onevcenter
|
44
42
|
- onevdc
|
45
|
-
- onevm
|
46
43
|
- onevnet
|
47
44
|
- onezone
|
45
|
+
- onevcenter
|
46
|
+
- onevm
|
47
|
+
- onehost
|
48
48
|
extensions: []
|
49
49
|
extra_rdoc_files: []
|
50
50
|
files:
|