Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Create external network fails. #777

Open
jpvrenen opened this issue Sep 1, 2021 · 2 comments
Open

Create external network fails. #777

jpvrenen opened this issue Sep 1, 2021 · 2 comments

Comments

@jpvrenen
Copy link

jpvrenen commented Sep 1, 2021

Create external network fails under following condition:

  • multiple vcenters
  • same portgroup name is used on different vcenters

possible issue/bug is found in --> pyvcloud/vcd/platform.py

From function
def create_external_network(

Only takes into account the portgroup name not the specified vcenter. (vim_server_name)
line 125 -> pg_morefs = self.get_port_group_morefs(port_group_names)

possible solution

Add vcenter (vim_server_name) as parameter to function
pg_morefs = self.get_port_group_morefs(port_group_names, vim_server_name)

From function
def get_port_group_morefs(self, port_group_names):

Modify into
def get_port_group_morefs(self, port_group_names, vim_server_name):

Add vcenter filter to existing query
vcfilter = 'vcName==%s' % urllib.parse.quote(vim_server_name)
query = self.client.get_typed_query( ResourceType.PORT_GROUP.value, qfilter=vcfilter, query_result_format=QueryResultFormat.RECORDS)

@scubar
Copy link

scubar commented Jan 27, 2023

Can confirm that this solution worked for me, would it be possible for you to provide a PR with these changes?

@jpvrenen
Copy link
Author

jpvrenen commented Feb 1, 2023

query

Thanks for confirming, I will apply for a PR.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants