Hi Guys,

After many trial and errors, we managed to delete the physical network.

Root Cause: Double entries (namely A & B) in DB's "networks" table when 
creating Private Gateway.

Suspected Reason: Suspect bug causing double entries (namely A & B) in DB's 
"networks" table when creating Private Gateway. Not sure if this is caused by 
using VXLAN which is not supported with Private Gateway. When Private Gateway 
is deleted, A's "state" is changed to "Destroy" but B's "state" did not change. 
Therefore, Physical Network cannot be deleted due to these records that aren't 
in "Destroy" state.

Solution: Alter DB manually and change these records "state" to "Destroy" and 
add date & time to "removed" columns

But just want to confirm if what we did was a good way of resolving the issue? 
Worried about side effects (break other things) from this manual change.


Regards,
Bryan
On 12 Jan 2024 at 9:49 PM +0800, Suresh Kumar Anaparti 
<sureshkumar.anapa...@gmail.com>, wrote:
> Hi Bryan,
>
> Are you sure the instances, networks, etc are deleted properly? It's a
> different error this time.
>
> Adding in detail with queries to check from your side. Before deleting a
> physical network, the following are checked (in the given order) for the
> physical network, and indicated through the respective message if the
> check passes. If all checks fail, the physical network is deleted.
>
> (i) any vlans allocated, in op_dc_vnet_alloc table
> SELECT * FROM cloud.op_dc_vnet_alloc WHERE physical_network_id = <physical
> network integer id> AND taken IS NOT NULL
>
> (ii) any guest networks exists, in networks table
> SELECT * FROM cloud.networks WHERE physical_network_id = <physical network
> integer id> AND removed IS NULL
>
> (iii) any IP addresses allocated, in user_ip_address table
> SELECT * FROM cloud.user_ip_address WHERE physical_network_id = <physical
> network integer id> AND state != 'Free'
>
> Get the physical network integer id using => SELECT id FROM
> cloud.physical_network WHERE uuid = '<physical network uuid>'
>
> Hope this helps.
>
> Regards,
> Suresh
>
> On Fri, Jan 12, 2024 at 1:29 PM Wei ZHOU <ustcweiz...@gmail.com> wrote:
>
> > Hi,
> >
> > As said in the error message, there are some networks associated with this
> > physical network.
> >
> > SELECT * FROM networks WHERE physical_network_id=<physical network id> AND
> > removed IS NULL;
> >
> > -Wei
> >
> >
> > On Fri, 12 Jan 2024 at 08:42, Bryan Tiang <bryantian...@hotmail.com>
> > wrote:
> >
> > > Hi Suresh,
> > >
> > > We tried that as well but still got the same result.
> > >
> > > This is really interesting… We are scratching our heads.
> > >
> > >
> > >
> > > Regards,
> > > Bryan
> > > On 12 Jan 2024 at 1:30 PM +0800, Suresh Kumar Anaparti <
> > > sureshkumar.anapa...@gmail.com>, wrote:
> > >
> > > Hi Bryan,
> > >
> > > It's the integer id of the physical network, not uuid.
> > >
> > > with uuid, check with this.
> > > SELECT * FROM cloud.op_dc_vnet_alloc WHERE physical_network_id = (SELECT
> > > id FROM cloud.physical_network WHERE uuid = '<physical network uuid>') AND
> > > taken IS NOT NULL
> > >
> > > Regards,
> > > Suresh
> > >
> > > On Fri, Jan 12, 2024 at 10:55 AM Bryan Tiang <bryantian...@hotmail.com>
> > > wrote:
> > >
> > > > Hi Suresh,
> > > >
> > > > So sorry for this. But we ran the query and this was the result.
> > > >
> > > > <>
> > > >
> > > > Could it be something else?
> > > >
> > > > Regards,
> > > > Bryan
> > > > On 11 Jan 2024 at 8:39 PM +0800, Suresh Kumar Anaparti <
> > > > sureshkumar.anapa...@gmail.com>, wrote:
> > > >
> > > > Hi Bryan,
> > > >
> > > > From the code, the error is due to some allocated vlans found through 
> > > > the
> > > > below query. If the result is empty, that error doesn't appear.
> > > >
> > > > SELECT * FROM cloud.op_dc_vnet_alloc WHERE physical_network_id =
> > > > <physical
> > > > network id> AND taken IS NOT NULL
> > > >
> > > > Regards,
> > > > Suresh
> > > >
> > > > On Thu, Jan 11, 2024 at 3:57 PM Bryan Tiang <bryantian...@hotmail.com>
> > > > wrote:
> > > >
> > > > Hi Suresh,
> > > >
> > > > Sorry, its Version 4.18.1
> > > >
> > > > Yes its the same error message as before:
> > > >
> > > > Delete physical network: (Physical Network 1) The Physical Network is 
> > > > not
> > > > deletable because there are allocated vnets for this physical network
> > > >
> > > > Version: 4.18.1
> > > > Hypervisor: Linux Ubuntu
> > > > Storage: Linbit
> > > >
> > > > Regards,
> > > > Bryan
> > > > On 11 Jan 2024 at 5:46 PM +0800, Suresh Kumar Anaparti <
> > > > sureshkumar.anapa...@gmail.com>, wrote:
> > > >
> > > > Hi Bryan,
> > > >
> > > > If 'taken' / other columns are NULL, you should see different error. Can
> > > > you confirm if it is still the same error for that physical network?
> > > >
> > > > What's
> > > >
> > > > the cloudstack version you are using?
> > > >
> > > > Regards,
> > > > Suresh
> > > >
> > > > On Thu, Jan 11, 2024 at 2:13 PM Bryan Tiang <bryantian...@hotmail.com>
> > > > wrote:
> > > >
> > > > Hi Suresh,
> > > >
> > > > We set it Null and got the same error:
> > > >
> > > > i. Updated 'taken' to NULL - same error
> > > > ii. Updated the other columns to NULL - same error
> > > > iii. Restarted management service and retry - same error
> > > >
> > > > Did we do something wrong?
> > > > <>
> > > >
> > > > Regards,
> > > > Bryan
> > > >
> > > >
> > > > On Thu, Jan 11, 2024 at 1:53 PM Suresh Kumar Anaparti <
> > > > sureshkumar.anapa...@gmail.com> wrote:
> > > >
> > > > Hi Bryan,
> > > >
> > > > If there are no network / nics for the vlan, you can update 'taken' to
> > > > NULL for that vlan in the op_dc_vnet_alloc table.
> > > >
> > > > Check network / nics usage with the below queries before update.
> > > > SELECT * FROM cloud.networks WHERE broadcast_uri LIKE '%<vlan id>%';
> > > > SELECT * FROM cloud.nics where broadcast_uri LIKE '%<vlan id>%';
> > > >
> > > > Regards,
> > > > Suresh
> > > >
> > > > On Thu, Jan 11, 2024 at 1:25 PM Bryan Tiang <bryantian...@hotmail.com>
> > > > wrote:
> > > >
> > > > Hi Suresh,
> > > >
> > > > Thank you! In this case, should we clear the data directly?
> > > >
> > > > Clear or amend to something else?
> > > >
> > > > Regards,
> > > > Bryan
> > > > On 11 Jan 2024 at 3:50 PM +0800, Suresh Kumar Anaparti <
> > > > sureshkumar.anapa...@gmail.com>, wrote:
> > > >
> > > > Hi Bryan,
> > > >
> > > > It seems there are still some vlans allocated. You can manually
> > > >
> > > > confirm
> > > >
> > > > from the db table 'op_dc_vnet_alloc'.
> > > >
> > > >
> > > > Check with the query below.
> > > > SELECT vnet, taken FROM cloud.op_dc_vnet_alloc WHERE
> > > >
> > > > physical_network_id = (SELECT id FROM cloud.physical_network WHERE
> > > >
> > > > uuid =
> > > >
> > > > '<physical network uuid>')
> > > >
> > > >
> > > > Regards,
> > > > Suresh
> > > >
> > > > On Thu, Jan 11, 2024 at 11:19 AM Bryan Tiang <
> > > >
> > > > bryantian...@hotmail.com> wrote:
> > > >
> > > > Hi Guys,
> > > >
> > > > Our setup is using VXLAN For Guest Networks.
> > > >
> > > > We're trying to delete physical network but encountered this
> > > >
> > > > error.
> > > >
> > > >
> > > > We've deleted all the instances, networks, system vms, hosts,
> > > >
> > > > pods
> > > >
> > > > and clusters and left with only the zone (disabled).
> > > >
> > > >
> > > > Can someone please help tell us what we are missing?
> > > >
> > > > <>
> > > > <>
> > > > Regards,
> > > > Bryan
> > > >
> > > >
> > > >
> > > >
> > > >

Reply via email to