07-25-2018 06:47 AM
Hi,
I have a package, called 'service1', in NSOv4.6 which is using resource-manager v3.3.0 to allocate id. In service1, my main.py looks like :
..some code..
# Create an allocation request. # After calling this function, you have to call response_ready # to check the availability of the allocated ID. id_allocator.id_request(service=service, svc_xpath="/service1[myname='{}']".format(service.myname), username=tctx.username, pool_name='my_index', allocation_name=service.myname, sync=False, requested_id=-1 )
# Returns the allocated ID or None my_index = id_allocator.id_read(username=tctx.username, root=root, pool_name='my_index', allocation_name=service.myname ) if not my_index: self.log.info('Index not YET allocated') return
..some code..
Now I need to push my service using three flags : commit-queue async, no-out-of-sync-check and atomic false. Unfortunately, if I perform a commit with those flags (in cli), it doesn't work : my id is well allocated but my service (service1) is not pushed to my device. There is an heritage problem of flags I think.
So how to handle this issue (if it is one, maybe it was done on purpose) ?
Thanks.
07-25-2018 07:02 AM - edited 07-25-2018 07:08 AM
You're right, the resource manager reactive-re-deploys your service. *edit* - actually the reactive-re-deploy should honor the flags you passed. Bug?
If this is a behavior you always want on this device, is it possible to permanently enable them on the device?
Second option, can you pre-create the allocation, e.g. by using an action? That way, then the service runs, the allocated value(s) is available, and the flags should be honored.
07-26-2018 12:12 AM
Actually I don't want to set global settings since I have other services that can be activated at the same time.
Your second idea seems good. I'll try it, do I need Pronghorn to manage my workflow like this ?
1-input : myinput + myflags
2-action to resource my id
3-launch my service1
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide