diff --git a/src/cloud/occi/etc/occi-server.conf b/src/cloud/occi/etc/occi-server.conf index 5ab9849e09..971326cd20 100644 --- a/src/cloud/occi/etc/occi-server.conf +++ b/src/cloud/occi/etc/occi-server.conf @@ -37,6 +37,9 @@ # 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG :debug_level: 3 +:cluster_id: +:datastore_id: + # VM types allowed and its template file (inside templates directory) :instance_types: :small: diff --git a/src/cloud/occi/lib/OCCIServer.rb b/src/cloud/occi/lib/OCCIServer.rb index a3102da56c..ee3fc5d406 100755 --- a/src/cloud/occi/lib/OCCIServer.rb +++ b/src/cloud/occi/lib/OCCIServer.rb @@ -342,7 +342,7 @@ class OCCIServer < CloudServer template = network.to_one_template return template, 500 if OpenNebula.is_error?(template) - rc = network.allocate(template) + rc = network.allocate(template, @config[:cluster_id]||ClusterPool::NONE_CLUSTER_ID) if OpenNebula.is_error?(rc) return rc, CloudServer::HTTP_ERROR_CODE[rc.errno] end @@ -446,7 +446,7 @@ class OCCIServer < CloudServer template = image.to_one_template return template, 500 if OpenNebula.is_error?(template) - rc = image.allocate(template) + rc = image.allocate(template, @config[:datastore_id]||1t) if OpenNebula.is_error?(rc) return rc, CloudServer::HTTP_ERROR_CODE[rc.errno] end