summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-02-13 18:58:09 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2017-02-13 18:58:09 +0800
commita42d2a3242d937de294209f994204c8ab048a0c8 (patch)
tree6551dafa8e8ebfcac4384f0b8ba0c265fffe14aa /lcm
parent86e28e16762a64dac6574126ff089e73cbc68e07 (diff)
call vim dirver adapter rollback res
Change-Id: I537d87870b89468808225965ca42ea0add50aa48 Issue-Id: GVNFM-8 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'lcm')
-rw-r--r--lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py b/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py
index 72cee0dd..6cbfeace 100644
--- a/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py
+++ b/lcm/lcm/nf/vnfs/vnf_create/inst_vnf.py
@@ -36,6 +36,14 @@ class InstVnf(Thread):
self.job_id = job_id
self.nfvo_inst_id = ''
self.vnfm_inst_id = ''
+ self.vnfd_info = []
+ self.inst_resource = {'volumn':[],#'volumn':[{"vim_id": "1"}, {"res_id": "2"}]
+ 'network':[],
+ 'subnet':[],
+ 'port':[],
+ 'flavor':[],
+ 'vm':[],
+ }
self.create_res_result = {
'jobid': 'res_001',
'resourceResult': [{'name': 'vm01'}, {'name': 'vm02'}],
@@ -121,6 +129,8 @@ class InstVnf(Thread):
initallocatedata=self.vnfd_info,
localizationLanguage=ignore_case_get(self.data, 'localizationLanguage'),
lastuptime=now_time())
+ JobUtil.add_job_status(self.job_id, 10, 'Nf instancing pre-check finish')
+ logger.info("Nf instancing pre-check finish")
def apply_grant(self):
logger.info('[NF instantiation] send resource grand request to nfvo start')
@@ -148,7 +158,7 @@ class InstVnf(Thread):
#update_resources_table()
NfInstModel.objects.filter(nfinstid=self.nf_inst_id).update(instantiationState='INSTANTIATED', lastuptime=now_time())
- JobUtil.add_job_status(self.job_id, 15, 'Nf instancing apply grant finish')
+ JobUtil.add_job_status(self.job_id, 20, 'Nf instancing apply grant finish')
logger.info("Nf instancing apply grant finish")
def create_res(self):
@@ -166,6 +176,7 @@ class InstVnf(Thread):
# create_vdus(vdus)
JobUtil.add_job_status(self.job_id, 75, 'Nf instancing create resource(vms) finish')
+ JobUtil.add_job_status(self.job_id, 20, 'Nf instancing apply grant finish')
logger.info("[NF instantiation] create resource end")
def check_res_status(self):
@@ -282,5 +293,7 @@ class InstVnf(Thread):
VmInstModel.objects.filter(instid=self.nf_inst_id).delete()
JobUtil.add_job_status(self.job_id, 255, 'Create resource failed')
+ def do_notify_delete(ret):
+ logger.error('Delete [%s] resource'%ret)