You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by "Daniel Estevez (JIRA)" <ji...@apache.org> on 2019/02/14 15:56:00 UTC
[jira] [Commented] (LIBCLOUD-1033) Cannot create a network
interface on Azure
[ https://issues.apache.org/jira/browse/LIBCLOUD-1033?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16768460#comment-16768460 ]
Daniel Estevez commented on LIBCLOUD-1033:
------------------------------------------
There's a problem with the script when creating the network interface, the parameter for _resourcegroup_ should be _resourcegroup.*name*_:
{code:java}
network_interface = driver.ex_create_network_interface( name='test-1-nic', subnet=subnet, resource_group=resource_group.name, location=location, ){code}
Passing the whole _resourcegroup_ object causes the parser to build an invalid URI that ARM interprets as a call to another REST entity (not the network interface) and therefore throws that misleading error message
{code:java}
The api-version '2015-06-15' is invalid.{code}
Please try the suggested modification
> Cannot create a network interface on Azure
> ------------------------------------------
>
> Key: LIBCLOUD-1033
> URL: https://issues.apache.org/jira/browse/LIBCLOUD-1033
> Project: Libcloud
> Issue Type: Bug
> Components: Compute
> Affects Versions: 2.4.0
> Reporter: Mitar
> Priority: Blocker
>
> It seems calling ex_create_network_interface is failing now with:
>
> {noformat}
> libcloud.common.exceptions.BaseHTTPError: [InvalidApiVersionParameter] The api-version '2015-06-15' is invalid. The supported versions are '2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.{noformat}
>
> I have a script like:
> {noformat}
> for location in driver.list_locations():
> if location.name == 'East US':
> break
> else:
> raise Exception("Location could not be found.")
> for size in driver.list_sizes(location=location):
> if size.name == 'Standard_D64s_v3':
> break
> else:
> raise Exception("Size could not be found.")
> for image in sorted(driver.list_images(location=location, ex_publisher='Canonical', ex_offer='UbuntuServer', ex_sku='18.04-LTS'), key=lambda i: i.version, reverse=True):
> break
> else:
> raise Exception("Image could not be found.")
> for resource_group in driver.ex_list_resource_groups():
> if resource_group.location == location.id and resource_group.name == 'shared':
> break
> else:
> raise Exception("Resource group could not be found.")
> for network in driver.ex_list_networks():
> if network.location == location.id and network.name == 'test':
> break
> else:
> raise Exception("Network could not be found.")
> for subnet in driver.ex_list_subnets(network=network):
> if subnet.name == 'default':
> break
> else:
> raise Exception("Subnet could not be found.")
> network_interface = driver.ex_create_network_interface(
> name='test-1-nic',
> subnet=subnet,
> resource_group=resource_group,
> location=location,
> ){noformat}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)