projects
/
osm
/
RO.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changes in vimconn_vmware.py : Patch to get DHCP leased addresses for Isolated networ...
[osm/RO.git]
/
vimconn_openvim.py
diff --git
a/vimconn_openvim.py
b/vimconn_openvim.py
index
d415532
..
4a0843b
100644
(file)
--- a/
vimconn_openvim.py
+++ b/
vimconn_openvim.py
@@
-591,8
+591,10
@@
class vimconnector(vimconn.vimconnector):
'''Adds a tenant flavor to VIM'''
'''Returns the flavor identifier'''
try:
'''Adds a tenant flavor to VIM'''
'''Returns the flavor identifier'''
try:
+ new_flavor_dict = flavor_data.copy()
+ new_flavor_dict["name"] = flavor_data["name"][:64]
self._get_my_tenant()
self._get_my_tenant()
- payload_req = json.dumps({'flavor':
flavor_data
})
+ payload_req = json.dumps({'flavor':
new_flavor_dict
})
url = self.url+'/'+self.tenant+'/flavors'
self.logger.info("Adding a new VIM flavor POST %s", url)
vim_response = requests.post(url, headers = self.headers_req, data=payload_req)
url = self.url+'/'+self.tenant+'/flavors'
self.logger.info("Adding a new VIM flavor POST %s", url)
vim_response = requests.post(url, headers = self.headers_req, data=payload_req)
@@
-647,7
+649,7
@@
class vimconnector(vimconn.vimconnector):
''' Adds a tenant image to VIM, returns image_id'''
try:
self._get_my_tenant()
''' Adds a tenant image to VIM, returns image_id'''
try:
self._get_my_tenant()
- new_image_dict={'name': image_dict['name']}
+ new_image_dict={'name': image_dict['name']
[:64]
}
if image_dict.get('description'):
new_image_dict['description'] = image_dict['description']
if image_dict.get('metadata'):
if image_dict.get('description'):
new_image_dict['description'] = image_dict['description']
if image_dict.get('metadata'):
@@
-776,7
+778,7
@@
class vimconnector(vimconn.vimconnector):
#print text
return -vim_response.status_code,text
#print text
return -vim_response.status_code,text
- def new_vminstance(self,name,description,start,image_id,flavor_id,net_list, cloud_config=None):
+ def new_vminstance(self,name,description,start,image_id,flavor_id,net_list, cloud_config=None
, disk_list=None
):
'''Adds a VM instance to VIM
Params:
start: indicates if VM must start or boot in pause mode. Ignored
'''Adds a VM instance to VIM
Params:
start: indicates if VM must start or boot in pause mode. Ignored
@@
-793,6
+795,7
@@
class vimconnector(vimconn.vimconnector):
#TODO ip, security groups
Returns the instance identifier
'''
#TODO ip, security groups
Returns the instance identifier
'''
+ self.logger.debug("new_vminstance input: image='%s' flavor='%s' nics='%s'", image_id, flavor_id, str(net_list))
try:
self._get_my_tenant()
# net_list = []
try:
self._get_my_tenant()
# net_list = []
@@
-811,7
+814,7
@@
class vimconnector(vimconn.vimconnector):
if net.get("model"): net_dict["model"] = net["model"]
if net.get("mac_address"): net_dict["mac_address"] = net["mac_address"]
virtio_net_list.append(net_dict)
if net.get("model"): net_dict["model"] = net["model"]
if net.get("mac_address"): net_dict["mac_address"] = net["mac_address"]
virtio_net_list.append(net_dict)
- payload_dict={ "name": name,
+ payload_dict={ "name": name
[:64]
,
"description": description,
"imageRef": image_id,
"flavorRef": flavor_id,
"description": description,
"imageRef": image_id,
"flavorRef": flavor_id,