Question regarding creating multiple instances

Hi,

Before all thanks to Zaid that created this awesome project.

I’m writing here regarding my trouble to create instances via provisioning script on my Iskratel Innbox G74 devices.
Everything done as documented. But got faults while provisioning script works.

For ex. I want to create 4 bridge, wanconnection instances using following script:

declare("InternetGatewayDevice.Layer2Bridging.Bridge.[BridgeEnable:true]", {path: now}, {path: 4}); } 
declare("InternetGatewayDevice.Layer2Bridging.Marking.[MarkingEnable:true]", {path: now}, {path: 4});
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection", {path: now}, {path: 1}); //single wanpppconnection
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection", {path: now}, {path: 3}); //3 wanipconnection

Got fault message:
too_many_commits Too many commit iterations

Access log:

2021-09-20T19:45:14.212Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId="17c04bda1cc013a" acsRequestName="DeleteObject"
2021-09-20T19:45:14.248Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId="17c04bda1cc013b" acsRequestName="GetParameterNames"
2021-09-20T19:45:14.302Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId="17c04bda1cc013c" acsRequestName="DeleteObject"
2021-09-20T19:45:14.334Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId="17c04bda1cc013d" acsRequestName="GetParameterNames"
2021-09-20T19:45:14.387Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId="17c04bda1cc013e" acsRequestName="DeleteObject"
2021-09-20T19:45:14.412Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId="17c04bda1cc013f" acsRequestName="GetParameterNames"
2021-09-20T19:45:14.458Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId="17c04bda1cc0140" acsRequestName="DeleteObject"
2021-09-20T19:45:14.481Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId="17c04bda1cc0141" acsRequestName="GetParameterNames"
2021-09-20T19:45:14.529Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId="17c04bda1cc0142" acsRequestName="DeleteObject"
2021-09-20T19:45:14.553Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId="17c04bda1cc0143" acsRequestName="GetParameterNames"
2021-09-20T19:45:14.598Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId="17c04bda1cc0144" acsRequestName="DeleteObject"
2021-09-20T19:45:14.625Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId="17c04bda1cc0145" acsRequestName="GetParameterNames"
2021-09-20T19:45:14.674Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId="17c04bda1cc0146" acsRequestName="DeleteObject"

The way you want to do this is to first tell GenieACS you want 0 instances, and then specify the params for each instance. For example:

declare("InternetGatewayDevice.Layer2Bridging.Bridge.[]", null, {path: 0});
declare("InternetGatewayDevice.Layer2Bridging.Bridge.[BridgeEnable:true,Alias:Inst1]", {path: now}, {path: 1});
declare("InternetGatewayDevice.Layer2Bridging.Bridge.[BridgeEnable:true,Alias:Inst2]", {path: now}, {path: 1});
declare("InternetGatewayDevice.Layer2Bridging.Bridge.[BridgeEnable:true,Alias:Inst3]", {path: now}, {path: 1});

The params need to be unique for this to work correctly. Otherwise if the you have something like this:

declare("InternetGatewayDevice.Layer2Bridging.Bridge.[]", null, {path: 0});
declare("InternetGatewayDevice.Layer2Bridging.Bridge.[BridgeEnable:true,Alias:Inst1]", {path: now}, {path: 1});
declare("InternetGatewayDevice.Layer2Bridging.Bridge.[BridgeEnable:true,Alias:Inst1]", {path: now}, {path: 1});

You would end up with only 1 instance, because the parameters are all the same.

I have 2 bridge instances by default. (After factory reset both of instances created by default)

br0 - for internet
br1 - for TR069

All I need create br2, br3 and etc…

So you will still need to specify the params for the existing instances, otherwise GenieACS will delete them.

Why Genieacs deletes objects if I dont delete them by script? Does it possible to prevent this?

2021-09-22T09:37:44.499Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId=“17c0cde2c290138” acsRequestName=“DeleteObject”
2021-09-22T09:37:44.529Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId=“17c0cde2c290139” acsRequestName=“GetParameterNames”
2021-09-22T09:37:44.592Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId=“17c0cde2c29013a” acsRequestName=“DeleteObject”
2021-09-22T09:37:44.628Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId=“17c0cde2c29013b” acsRequestName=“GetParameterNames”
2021-09-22T09:37:44.680Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId=“17c0cde2c29013c” acsRequestName=“DeleteObject”
2021-09-22T09:37:44.704Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId=“17c0cde2c29013d” acsRequestName=“GetParameterNames”
2021-09-22T09:37:44.757Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId=“17c0cde2c29013e” acsRequestName=“DeleteObject”
2021-09-22T09:37:44.789Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId=“17c0cde2c29013f” acsRequestName=“GetParameterNames”
2021-09-22T09:37:44.834Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId=“17c0cde2c290140” acsRequestName=“DeleteObject”
2021-09-22T09:37:44.861Z [INFO] ::ffff:10.255.255.60 646EEA-InnboxG74-49534B5461A7E938: ACS request; acsRequestId=“17c0cde2c290141” acsRequestName=“GetParameterNames”

event: outgoing HTTP response
timestamp: 2021-09-22T09:37:44.500Z
remoteAddress: “::ffff:10.255.255.60”
deviceId: 646EEA-InnboxG74-49534B5461A7E938
connection: 2021-09-22T09:37:39.406Z
statusCode: 200
headers:
content-length: 602
server: GenieACS/1.2.7+20210919001756
soapserver: GenieACS/1.2.7+20210919001756
content-type: text/xml; charset=“utf-8”
body: >-

<?xml version="1.0" encoding="UTF-8"?>

<soap-env:Envelope xmlns:soap-enc=“http://schemas.xmlsoap.org/soap/encoding/
xmlns:soap-env=“http://schemas.xmlsoap.org/soap/envelope/
xmlns:xsd=“http://www.w3.org/2001/XMLSchema
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance
xmlns:cwmp=“urn:dslforum-org:cwmp-1-2”>soap-env:Header<cwmp:ID
soap-env:mustUnderstand=“1”>17c0cde2c290138</cwmp:ID></soap-env:Header>soap-env:Bodycwmp:DeleteObjectInternetGatewayDevice.Layer2Bridging.Marking.2.

It does this because the provision script tells it to start with 0 instances
declare("InternetGatewayDevice.Layer2Bridging.Bridge.[]", null, {path: 0});
and you haven’t specified any objects that should exist.

You have to put all the objects in the same session, otherwise anything not specified will be deleted.

No. I dont use declare("InternetGatewayDevice.Layer2Bridging.Bridge.[]", null, {path: 0});

Here is script:

declare("InternetGatewayDevice.Layer2Bridging.Bridge.[BridgeEnable:"+((cfg.sip.cpe_sip_set === "1") ? 'true' : 'false')+",BridgeName:"+cpe_prefix+"-SIP]", {path: now}, {path: 1});
	declare("InternetGatewayDevice.Layer2Bridging.Marking.[MarkingEnable:true]", {path: now}, {path: 1});
	declare("InternetGatewayDevice.Layer2Bridging.Filter.[FilterEnable:true]", {path: now}, {path: 1});

	declare("InternetGatewayDevice.Layer2Bridging.Bridge.[BridgeEnable:"+((cfg.sip.cpe_iptv_set === "1") ? 'true' : 'false')+",BridgeName:"+cpe_prefix+"-IPTVMCAST]", {path: now}, {path: 1});
	declare("InternetGatewayDevice.Layer2Bridging.Marking.[MarkingEnable:true]", {path: now}, {path: 1});
	declare("InternetGatewayDevice.Layer2Bridging.Filter.[FilterEnable:true]", {path: now}, {path: 1});

	declare("InternetGatewayDevice.Layer2Bridging.Bridge.[BridgeEnable:"+((cfg.sip.cpe_datavlan_set === "1") ? 'true' : 'false')+",BridgeName:"+cpe_prefix+"-DATAVLAN]", {path: now}, {path: 1});
	declare("InternetGatewayDevice.Layer2Bridging.Marking.[MarkingEnable:true]", {path: now}, {path: 1});		
	declare("InternetGatewayDevice.Layer2Bridging.Filter.[FilterEnable:true]", {path: now}, {path: 1});

I dont tell to GenieACS delete objects…

Is that the entire script?

Yes I removed entire code leaved only variables and above declares for test.

Same result…

I believe you have to specify all the instances you want to stay. Maybe @zaidka can weigh in.

When you specify the number of instances, it’ll make sure exactly that number of instances are present matching the given filter. For example:

declare("InternetGatewayDevice.Layer2Bridging.Marking.[MarkingEnable:true]", {path: now}, {path: 4});

If this line is triggering DeleteObject requets, then there must have been more than 4 instances with MarkingEnable = true to begin with.

Hi, Zaid.

Yes, I have preconfigured instances on CPE by factory (TR-069 management, default bridge0). How can I prevent DeleteObject requests and create new instances but prevent to remove existing instances?

See above.

Expanding on @akcoder’s comments, make sure the alias part in your parameter paths (e.g. [MarkingEnable:true]) is unique and doens’t match any of the preexisting instances.

Another thing you could try is specifying your path attribute as a pair of min, max numbers:

declare("InternetGatewayDevice.Layer2Bridging.Marking.[MarkingEnable:true]", {path: now}, {path: [4, 99]});

Here it will never delete the existing instances. 99 is just an arbitrary number. Though I hesitate to suggest this method because I don’t recall ever needing to use it so it’s probably not what you needed.

1 Like