# In which subnet does IC.create\_canister create a canister?

**URL:** <https://forum.dfinity.org/t/in-which-subnet-does-ic-create-canister-create-a-canister/33279>\
**Category:** Developers\
**Created:** [July 16, 2024, 4:32pm UTC](https://forum.dfinity.org/t/in-which-subnet-does-ic-create-canister-create-a-canister/33279 "2024-07-16T16:32:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![qwertytrewq](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/qwertytrewq/32/10423_2.png) [@qwertytrewq](https://forum.dfinity.org/u/qwertytrewq)\
**Post date:** [July 16, 2024, 4:32pm UTC](https://forum.dfinity.org/t/in-which-subnet-does-ic-create-canister-create-a-canister/33279/1 "2024-07-16T16:32:41Z")

</div>

[The IC chooses an appropriate canister id (referred to as CanisterId) and subnet id (referred to as SubnetId, SubnetId ∈ Subnets, where Subnets is the under-specified set of subnet ids on the IC)](https://internetcomputer.org/docs/current/references/ic-interface-spec#ic-management-canister-canister-creation).

So, what is the practical criterion of selection of a subnet by `IC.create_canister` (where `IC` is the management canister)?

I expect that it is created on a random subnet if `IC.create_canister` is called through HTTPS gateway (not by a canister) and the same subnet as the calling canister if called from a canister, except if the current subnet is too full, in which case it would use a random canister.

Does this my expectation match reality?

What to do with nonexistent description in the docs in which subnet `IC.create_canister` creates the canister? Should I refrain from use `IC.create_canister` and instead use `Ledger.create_canister` (where `Ledger` is a ledger canister)?

---

<div class="post-metadata">

**Author:** ![jennifertran](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jennifertran/32/11558_2.png) [@jennifertran](https://forum.dfinity.org/u/jennifertran)\
**Post date:** [July 16, 2024, 6:53pm UTC](https://forum.dfinity.org/t/in-which-subnet-does-ic-create-canister-create-a-canister/33279/2 "2024-07-16T18:53:27Z")

</div>

Yes, if no subnet is specified, the IC chooses a random [subnet](https://github.com/dfinity/ic/blob/fb898b290cbbbcd3ac9081b7ed193a93cc3b6edb/rs/nns/cmc/src/lib.rs#L130).

I am confused by your follow-up questions about deploying different canisters from other canisters.

Remember that ICP provides additional functionality, such as canister and user management. This functionality is exposed to external users and canisters via the IC [management canister](https://internetcomputer.org/docs/current/references/ic-interface-spec#ic-management-canister). However, IC management canister is not a canister but more of a facade.

---

<div class="post-metadata">

**Author:** ![qwertytrewq](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/qwertytrewq/32/10423_2.png) [@qwertytrewq](https://forum.dfinity.org/u/qwertytrewq)\
**Post date:** [July 16, 2024, 7:12pm UTC](https://forum.dfinity.org/t/in-which-subnet-does-ic-create-canister-create-a-canister/33279/3 "2024-07-16T19:12:15Z")

</div>

> [@jennifertran](#):
>
> I am confused by your follow-up questions about deploying different canisters from other canisters.

I mean that I call `IC.create_canister` from an already deployed canister (let’s call it “calling canister”). Is in this case the deployed canister also on a random subnet? Or does it prefer to add it to the same canister as the calling canister?

---

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [July 17, 2024, 7:52am UTC](https://forum.dfinity.org/t/in-which-subnet-does-ic-create-canister-create-a-canister/33279/4 "2024-07-17T07:52:33Z")

</div>

It is not possible to call `aaaaa-aa:create_canister` as an ingress message. The call to the management canister requires you to attach cycles, which is impossible if you do it from anywhere other than a canister. If you call it through a canister, the new canister will always be created on the same subnet as that canister already lives on. If it is full and won’t accept new canisters, then the call fails.

The other way to create canisters is through the CMC, either with `notify_create_canister`, or `create_canister`. There you can specify a subnet. If you don’t specify a subnet, then the CMC has a list of subnets on which anyone can create canisters and picks a random one of these.
