pyvcloud
pyvcloud copied to clipboard
Create external network fails.
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)
Can confirm that this solution worked for me, would it be possible for you to provide a PR with these changes?
query
Thanks for confirming, I will apply for a PR.