# Question regarding creating multiple instances

**URL:** <https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038>\
**Category:** Uncategorized\
**Created:** [September 20, 2021, 7:59pm UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038 "2021-09-20T19:59:33Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![nadiritus](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@nadiritus](https://forum.genieacs.com/u/nadiritus)\
**Post date:** [September 20, 2021, 7:59pm UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/1 "2021-09-20T19:59:33Z")

</div>

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:

```auto
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:

```auto
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"

```

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [September 20, 2021, 8:51pm UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/2 "2021-09-20T20:51:27Z")

</div>

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:

```auto
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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![nadiritus](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@nadiritus](https://forum.genieacs.com/u/nadiritus)\
**Post date:** [September 21, 2021, 7:30am UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/3 "2021-09-21T07:30:21Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [September 21, 2021, 6:25pm UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/4 "2021-09-21T18:25:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nadiritus](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@nadiritus](https://forum.genieacs.com/u/nadiritus)\
**Post date:** [September 22, 2021, 9:41am UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/5 "2021-09-22T09:41:33Z")

</div>

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/](http://schemas.xmlsoap.org/soap/encoding/)”  
xmlns:soap-env=“[http://schemas.xmlsoap.org/soap/envelope/](http://schemas.xmlsoap.org/soap/envelope/)”  
xmlns:xsd=“[http://www.w3.org/2001/XMLSchema](http://www.w3.org/2001/XMLSchema)”  
xmlns:xsi=“[http://www.w3.org/2001/XMLSchema-instance](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.

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [September 22, 2021, 4:04pm UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/6 "2021-09-22T16:04:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nadiritus](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@nadiritus](https://forum.genieacs.com/u/nadiritus)\
**Post date:** [September 22, 2021, 6:24pm UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/7 "2021-09-22T18:24:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![nadiritus](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@nadiritus](https://forum.genieacs.com/u/nadiritus)\
**Post date:** [September 22, 2021, 6:29pm UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/8 "2021-09-22T18:29:37Z")

</div>

Here is script:

```auto
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…

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [September 22, 2021, 6:36pm UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/9 "2021-09-22T18:36:54Z")

</div>

Is that the entire script?

---

<div class="post-metadata">

**Author:** ![nadiritus](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@nadiritus](https://forum.genieacs.com/u/nadiritus)\
**Post date:** [September 23, 2021, 6:03am UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/10 "2021-09-23T06:03:42Z")

</div>

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

Same result…

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [September 23, 2021, 8:32pm UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/11 "2021-09-23T20:32:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [September 23, 2021, 10:32pm UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/12 "2021-09-23T22:32:07Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![nadiritus](https://avatars.discourse-cdn.com/v4/letter/n/848f3c/32.png) [@nadiritus](https://forum.genieacs.com/u/nadiritus)\
**Post date:** [September 24, 2021, 6:26pm UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/13 "2021-09-24T18:26:31Z")

</div>

> [@akcoder](#):
>
> I believe you have to specify all the instances you want to stay. Maybe @zaidka can weigh in.

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?

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [September 24, 2021, 6:40pm UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/14 "2021-09-24T18:40:19Z")

</div>

> [@akcoder](#):
>
> So you will still need to specify the params for the existing instances, otherwise GenieACS will delete them.

> [@akcoder](#):
>
> You have to put all the objects in the same session, otherwise anything not specified will be deleted.

See above.

---

<div class="post-metadata">

**Author:** ![zaidka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/zaidka/32/9_2.png) [@zaidka](https://forum.genieacs.com/u/zaidka)\
**Post date:** [September 24, 2021, 10:41pm UTC](https://forum.genieacs.com/t/question-regarding-creating-multiple-instances/2038/15 "2021-09-24T22:41:10Z")

</div>

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.
