opennebula 4.14.2 → 4.90.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NOTICE +1 -1
- data/lib/cloud/CloudClient.rb +3 -3
- data/lib/opennebula.rb +8 -2
- data/lib/opennebula/acl.rb +20 -14
- data/lib/opennebula/acl_pool.rb +1 -1
- data/lib/opennebula/client.rb +1 -1
- data/lib/opennebula/cluster.rb +1 -1
- data/lib/opennebula/cluster_pool.rb +1 -1
- data/lib/opennebula/datastore.rb +2 -2
- data/lib/opennebula/datastore_pool.rb +3 -3
- data/lib/opennebula/document.rb +16 -1
- data/lib/opennebula/document_json.rb +13 -1
- data/lib/opennebula/document_pool.rb +1 -1
- data/lib/opennebula/document_pool_json.rb +1 -1
- data/lib/opennebula/error.rb +1 -1
- data/lib/opennebula/group.rb +17 -10
- data/lib/opennebula/group_pool.rb +1 -1
- data/lib/opennebula/host.rb +26 -14
- data/lib/opennebula/host_pool.rb +1 -1
- data/lib/opennebula/image.rb +7 -3
- data/lib/opennebula/image_pool.rb +1 -2
- data/lib/opennebula/ldap_auth.rb +1 -1
- data/lib/opennebula/ldap_auth_spec.rb +1 -1
- data/lib/opennebula/marketplace.rb +161 -0
- data/lib/opennebula/marketplace_pool.rb +55 -0
- data/lib/opennebula/marketplaceapp.rb +267 -0
- data/lib/opennebula/marketplaceapp_pool.rb +77 -0
- data/lib/opennebula/oneflow_client.rb +10 -8
- data/lib/opennebula/pool.rb +1 -1
- data/lib/opennebula/pool_element.rb +1 -1
- data/lib/opennebula/security_group.rb +43 -2
- data/lib/opennebula/security_group_pool.rb +1 -1
- data/lib/opennebula/server_cipher_auth.rb +1 -1
- data/lib/opennebula/server_x509_auth.rb +1 -1
- data/lib/opennebula/ssh_auth.rb +1 -1
- data/lib/opennebula/system.rb +1 -1
- data/lib/opennebula/template.rb +42 -13
- data/lib/opennebula/template_pool.rb +1 -1
- data/lib/opennebula/user.rb +1 -1
- data/lib/opennebula/user_pool.rb +1 -1
- data/lib/opennebula/vdc.rb +1 -1
- data/lib/opennebula/vdc_pool.rb +1 -1
- data/lib/opennebula/virtual_machine.rb +65 -50
- data/lib/opennebula/virtual_machine_pool.rb +1 -1
- data/lib/opennebula/virtual_network.rb +13 -2
- data/lib/opennebula/virtual_network_pool.rb +1 -1
- data/lib/opennebula/virtual_router.rb +203 -0
- data/lib/opennebula/virtual_router_pool.rb +79 -0
- data/lib/opennebula/x509_auth.rb +1 -1
- data/lib/opennebula/xml_element.rb +6 -1
- data/lib/opennebula/xml_pool.rb +1 -1
- data/lib/opennebula/xml_utils.rb +1 -1
- data/lib/opennebula/zone.rb +1 -1
- data/lib/opennebula/zone_pool.rb +1 -1
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e860fb8028ca5276c55c13bb41ce2661310ecc33
|
4
|
+
data.tar.gz: 1fbbe122e328a30e83a6fa7cd3408efea2710610
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d6281be6b49fb27cb38cfa03d79c9d6c5addb7615b164202c07150e60b4e5a1429afd07d587dc9200f15d0b0639b5c3abbff6307238232b680f965e063c98d3
|
7
|
+
data.tar.gz: 0bcb4214d63d82cf507d8c952126b510f6257b38a4e5b5b95bfa2731480141888a6f7d060573d00be1f8fb392eecaf5aeddc512c67caa29faec680ca1d1221c3
|
data/NOTICE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
OpenNebula Open Source Project
|
2
2
|
--------------------------------------------------------------------------------
|
3
|
-
Copyright 2002-
|
3
|
+
Copyright 2002-2016, OpenNebula Project, OpenNebula Systems (formerly C12G Labs)
|
4
4
|
--------------------------------------------------------------------------------
|
5
5
|
|
6
6
|
You can find more information about the project, release notes and
|
data/lib/cloud/CloudClient.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -50,7 +50,7 @@ end
|
|
50
50
|
module CloudClient
|
51
51
|
|
52
52
|
# OpenNebula version
|
53
|
-
VERSION = '4.
|
53
|
+
VERSION = '4.90.0'
|
54
54
|
|
55
55
|
# #########################################################################
|
56
56
|
# Default location for the authentication file
|
@@ -201,7 +201,7 @@ module CloudCLI
|
|
201
201
|
def version_text
|
202
202
|
version=<<EOT
|
203
203
|
OpenNebula #{CloudClient::VERSION}
|
204
|
-
Copyright 2002-
|
204
|
+
Copyright 2002-2016, OpenNebula Project, OpenNebula Systems
|
205
205
|
|
206
206
|
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
207
207
|
not use this file except in compliance with the License. You may obtain
|
data/lib/opennebula.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -56,9 +56,15 @@ require 'opennebula/security_group_pool'
|
|
56
56
|
require 'opennebula/vdc'
|
57
57
|
require 'opennebula/vdc_pool'
|
58
58
|
require 'opennebula/system'
|
59
|
+
require 'opennebula/virtual_router'
|
60
|
+
require 'opennebula/virtual_router_pool'
|
61
|
+
require 'opennebula/marketplace'
|
62
|
+
require 'opennebula/marketplace_pool'
|
63
|
+
require 'opennebula/marketplaceapp'
|
64
|
+
require 'opennebula/marketplaceapp_pool'
|
59
65
|
|
60
66
|
module OpenNebula
|
61
67
|
|
62
68
|
# OpenNebula version
|
63
|
-
VERSION = '4.
|
69
|
+
VERSION = '4.90.0'
|
64
70
|
end
|
data/lib/opennebula/acl.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -33,6 +33,9 @@ module OpenNebula
|
|
33
33
|
# ACL
|
34
34
|
# SECGROUP
|
35
35
|
# VDC
|
36
|
+
# VROUTER
|
37
|
+
# MARKETPLACE
|
38
|
+
# MARKETPLACEAPP
|
36
39
|
# RIGHTS -> + separated list
|
37
40
|
# USE
|
38
41
|
# MANAGE
|
@@ -49,19 +52,22 @@ module OpenNebula
|
|
49
52
|
|
50
53
|
RESOURCES =
|
51
54
|
{
|
52
|
-
"VM" =>
|
53
|
-
"HOST" =>
|
54
|
-
"NET" =>
|
55
|
-
"IMAGE" =>
|
56
|
-
"USER" =>
|
57
|
-
"TEMPLATE" =>
|
58
|
-
"GROUP" =>
|
59
|
-
"DATASTORE" =>
|
60
|
-
"CLUSTER" =>
|
61
|
-
"DOCUMENT" =>
|
62
|
-
"ZONE" =>
|
63
|
-
"SECGROUP" =>
|
64
|
-
"VDC" =>
|
55
|
+
"VM" => 0x1000000000,
|
56
|
+
"HOST" => 0x2000000000,
|
57
|
+
"NET" => 0x4000000000,
|
58
|
+
"IMAGE" => 0x8000000000,
|
59
|
+
"USER" => 0x10000000000,
|
60
|
+
"TEMPLATE" => 0x20000000000,
|
61
|
+
"GROUP" => 0x40000000000,
|
62
|
+
"DATASTORE" => 0x100000000000,
|
63
|
+
"CLUSTER" => 0x200000000000,
|
64
|
+
"DOCUMENT" => 0x400000000000,
|
65
|
+
"ZONE" => 0x800000000000,
|
66
|
+
"SECGROUP" => 0x1000000000000,
|
67
|
+
"VDC" => 0x2000000000000,
|
68
|
+
"VROUTER" => 0x4000000000000,
|
69
|
+
"MARKETPLACE" => 0x8000000000000,
|
70
|
+
"MARKETPLACEAPP"=> 0x10000000000000
|
65
71
|
}
|
66
72
|
|
67
73
|
RIGHTS =
|
data/lib/opennebula/acl_pool.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
data/lib/opennebula/client.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
data/lib/opennebula/cluster.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
data/lib/opennebula/datastore.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -85,7 +85,7 @@ module OpenNebula
|
|
85
85
|
# Allocates a new Datastore in OpenNebula
|
86
86
|
#
|
87
87
|
# @param description [String] The template of the Datastore.
|
88
|
-
# @param cluster_id [Integer] Id of the cluster
|
88
|
+
# @param cluster_id [Integer] Id of the cluster, -1 to use default
|
89
89
|
#
|
90
90
|
# @return [Integer, OpenNebula::Error] the new ID in case of
|
91
91
|
# success, error otherwise
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -36,9 +36,9 @@ module OpenNebula
|
|
36
36
|
super('DATASTORE_POOL','DATASTORE',client)
|
37
37
|
end
|
38
38
|
|
39
|
-
# Factory method to create
|
39
|
+
# Factory method to create datastore objects
|
40
40
|
def factory(element_xml)
|
41
|
-
OpenNebula::
|
41
|
+
OpenNebula::Datastore.new(element_xml,@client)
|
42
42
|
end
|
43
43
|
|
44
44
|
#######################################################################
|
data/lib/opennebula/document.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -134,6 +134,21 @@ module OpenNebula
|
|
134
134
|
super(DOCUMENT_METHODS[:update], new_template, append ? 1 : 0)
|
135
135
|
end
|
136
136
|
|
137
|
+
# Replaces the raw template contents
|
138
|
+
#
|
139
|
+
# @param template [String] New template contents, in the form KEY = VAL
|
140
|
+
# @param append [true, false] True to append new attributes instead of
|
141
|
+
# replace the whole template
|
142
|
+
#
|
143
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
144
|
+
# otherwise
|
145
|
+
def update_raw(template_raw, append=false)
|
146
|
+
rc = check_type()
|
147
|
+
return rc if OpenNebula.is_error?(rc)
|
148
|
+
|
149
|
+
return call(DOCUMENT_METHODS[:update], @pe_id, template_raw, append ? 1 : 0)
|
150
|
+
end
|
151
|
+
|
137
152
|
# Changes the owner/group
|
138
153
|
#
|
139
154
|
# @param [Integer] uid the new owner id. Set to -1 to leave the current one
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -70,6 +70,18 @@ module OpenNebula
|
|
70
70
|
super(text, append)
|
71
71
|
end
|
72
72
|
|
73
|
+
# Replaces the raw template contents
|
74
|
+
#
|
75
|
+
# @param template [String] New template contents, in the form KEY = VAL
|
76
|
+
# @param append [true, false] True to append new attributes instead of
|
77
|
+
# replace the whole template
|
78
|
+
#
|
79
|
+
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
80
|
+
# otherwise
|
81
|
+
def update_raw(template_raw, append=false)
|
82
|
+
super(template_raw, append)
|
83
|
+
end
|
84
|
+
|
73
85
|
# Generates a json representing the object
|
74
86
|
#
|
75
87
|
# @param [true, false] pretty_generate
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
data/lib/opennebula/error.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
data/lib/opennebula/group.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -37,7 +37,7 @@ module OpenNebula
|
|
37
37
|
SELF = -1
|
38
38
|
|
39
39
|
# Default resource ACL's for group users (create)
|
40
|
-
GROUP_DEFAULT_ACLS = "VM+IMAGE+TEMPLATE+DOCUMENT+SECGROUP"
|
40
|
+
GROUP_DEFAULT_ACLS = "VM+IMAGE+TEMPLATE+DOCUMENT+SECGROUP+VROUTER"
|
41
41
|
|
42
42
|
# The default view for group and group admins, must be defined in
|
43
43
|
# sunstone_views.yaml
|
@@ -139,31 +139,38 @@ module OpenNebula
|
|
139
139
|
return OpenNebula::Error.new(error_msg)
|
140
140
|
end
|
141
141
|
|
142
|
-
|
142
|
+
sunstone_attrs = []
|
143
143
|
|
144
144
|
# Add Sunstone views for the group
|
145
145
|
if group_hash[:views]
|
146
|
-
|
146
|
+
sunstone_attrs << "VIEWS=\"#{group_hash[:views].join(",")}\""
|
147
147
|
end
|
148
148
|
|
149
149
|
if group_hash[:default_view]
|
150
|
-
|
150
|
+
sunstone_attrs << "DEFAULT_VIEW=\"#{group_hash[:default_view]}\""
|
151
151
|
end
|
152
152
|
|
153
153
|
# And the admin views
|
154
154
|
if group_hash[:admin_views]
|
155
|
-
|
155
|
+
sunstone_attrs << "GROUP_ADMIN_VIEWS=\"#{group_hash[:admin_views].join(",")}\""
|
156
156
|
else
|
157
|
-
|
157
|
+
sunstone_attrs << "GROUP_ADMIN_VIEWS=#{GROUP_ADMIN_SUNSTONE_VIEWS}"
|
158
158
|
end
|
159
159
|
|
160
160
|
if group_hash[:default_admin_view]
|
161
|
-
|
161
|
+
sunstone_attrs << "GROUP_ADMIN_DEFAULT_VIEW=\"#{group_hash[:default_admin_view]}\""
|
162
162
|
else
|
163
|
-
|
163
|
+
sunstone_attrs << "GROUP_ADMIN_DEFAULT_VIEW=#{GROUP_ADMIN_SUNSTONE_VIEWS}"
|
164
164
|
end
|
165
165
|
|
166
|
-
|
166
|
+
if sunstone_attrs.length > 0
|
167
|
+
rc = self.update("SUNSTONE=[#{sunstone_attrs.join(",\n")}]", true)
|
168
|
+
if OpenNebula.is_error?(rc)
|
169
|
+
self.delete
|
170
|
+
error_msg = "Error updating group template: #{rc.message}"
|
171
|
+
return OpenNebula::Error.new(error_msg)
|
172
|
+
end
|
173
|
+
end
|
167
174
|
|
168
175
|
return 0
|
169
176
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
data/lib/opennebula/host.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|
@@ -24,28 +24,35 @@ module OpenNebula
|
|
24
24
|
# Constants and Class Methods
|
25
25
|
#######################################################################
|
26
26
|
|
27
|
-
|
28
27
|
HOST_METHODS = {
|
29
28
|
:info => "host.info",
|
30
29
|
:allocate => "host.allocate",
|
31
30
|
:delete => "host.delete",
|
32
|
-
:
|
31
|
+
:status => "host.status",
|
33
32
|
:update => "host.update",
|
34
33
|
:monitoring => "host.monitoring",
|
35
34
|
:rename => "host.rename"
|
36
35
|
}
|
37
36
|
|
38
|
-
HOST_STATES=%w{INIT MONITORING_MONITORED MONITORED ERROR DISABLED
|
37
|
+
HOST_STATES=%w{INIT MONITORING_MONITORED MONITORED ERROR DISABLED
|
38
|
+
MONITORING_ERROR MONITORING_INIT MONITORING_DISABLED OFFLINE}
|
39
39
|
|
40
40
|
SHORT_HOST_STATES={
|
41
41
|
"INIT" => "init",
|
42
42
|
"MONITORING_MONITORED" => "update",
|
43
43
|
"MONITORED" => "on",
|
44
44
|
"ERROR" => "err",
|
45
|
-
"DISABLED" => "
|
45
|
+
"DISABLED" => "dsbl",
|
46
46
|
"MONITORING_ERROR" => "retry",
|
47
47
|
"MONITORING_INIT" => "init",
|
48
|
-
"MONITORING_DISABLED" => "
|
48
|
+
"MONITORING_DISABLED" => "dsbl",
|
49
|
+
"OFFLINE" => "off"
|
50
|
+
}
|
51
|
+
|
52
|
+
HOST_STATUS={
|
53
|
+
"ENABLED" => 0,
|
54
|
+
"DISABLED" => 1,
|
55
|
+
"OFFLINE" => 2
|
49
56
|
}
|
50
57
|
|
51
58
|
# Creates a Host description with just its identifier
|
@@ -89,13 +96,12 @@ module OpenNebula
|
|
89
96
|
# @param hostname [String] Name of the new Host.
|
90
97
|
# @param im [String] Name of the im_driver (information/monitoring)
|
91
98
|
# @param vmm [String] Name of the vmm_driver (hypervisor)
|
92
|
-
# @param
|
93
|
-
# @param cluster_id [String] Id of the cluster
|
99
|
+
# @param cluster_id [String] Id of the cluster, -1 to use default
|
94
100
|
#
|
95
101
|
# @return [Integer, OpenNebula::Error] the new ID in case of
|
96
102
|
# success, error otherwise
|
97
|
-
def allocate(hostname,im,vmm,
|
98
|
-
super(HOST_METHODS[:allocate],hostname,im,vmm,
|
103
|
+
def allocate(hostname, im, vmm, cluster_id=ClusterPool::NONE_CLUSTER_ID)
|
104
|
+
super(HOST_METHODS[:allocate], hostname, im, vmm, cluster_id)
|
99
105
|
end
|
100
106
|
|
101
107
|
# Deletes the Host
|
@@ -105,12 +111,17 @@ module OpenNebula
|
|
105
111
|
|
106
112
|
# Enables the Host
|
107
113
|
def enable()
|
108
|
-
|
114
|
+
set_status("ENABLED")
|
109
115
|
end
|
110
116
|
|
111
117
|
# Disables the Host
|
112
118
|
def disable()
|
113
|
-
|
119
|
+
set_status("DISABLED")
|
120
|
+
end
|
121
|
+
|
122
|
+
# Sets the Host offline
|
123
|
+
def offline()
|
124
|
+
set_status("OFFLINE")
|
114
125
|
end
|
115
126
|
|
116
127
|
def flush()
|
@@ -217,6 +228,7 @@ module OpenNebula
|
|
217
228
|
return rc if OpenNebula.is_error?(rc)
|
218
229
|
|
219
230
|
vm.deploy(id, false)
|
231
|
+
return vm.id
|
220
232
|
end
|
221
233
|
|
222
234
|
#######################################################################
|
@@ -255,10 +267,10 @@ module OpenNebula
|
|
255
267
|
end
|
256
268
|
|
257
269
|
private
|
258
|
-
def
|
270
|
+
def set_status(status)
|
259
271
|
return Error.new('ID not defined') if !@pe_id
|
260
272
|
|
261
|
-
rc = @client.call(HOST_METHODS[:
|
273
|
+
rc = @client.call(HOST_METHODS[:status], @pe_id, HOST_STATUS[status])
|
262
274
|
rc = nil if !OpenNebula.is_error?(rc)
|
263
275
|
|
264
276
|
return rc
|
data/lib/opennebula/host_pool.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
2
|
-
# Copyright 2002-
|
2
|
+
# Copyright 2002-2016, OpenNebula Project, OpenNebula Systems #
|
3
3
|
# #
|
4
4
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
5
5
|
# not use this file except in compliance with the License. You may obtain #
|