[ 
https://issues.apache.org/jira/browse/JCLOUDS-1311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16052021#comment-16052021
 ] 

Ignasi Barrera commented on JCLOUDS-1311:
-----------------------------------------

Well, you don't have to build the URL. You need to pass the ID of an existing 
Subnet. It could make sense to rename the method to {{subnetId}} or to make it 
accept a {{Subnet}} object parameter instead, but it is not meant to be used by 
manually building a URL: just to receive a reference to an existing subnet.

Your approach still presents the same issue: providing the resource group and 
the names for the network and subnet is not enough. You need to provide, at 
least, the CIDR for the network and the one for the subnet. Do we keep them as 
context properties? If so, why are we configuring some stuff via context 
properties and other stuff via template options? That is not consistent (and 
something I'd like to still fix in the current implementation). Otherwise, if 
we expose them as additional template options, why not exposing all the 
networking options? If we go this path, we end up with the problem I mentioned 
in my previous comment.

I think the abstraction should just ask for a subnet reference when users want 
more fine-grained configuration (it is what it does now), and that the current 
one is a better default, given we want to support any resource group layout and 
not force users to a particular one. Other default network configurations can 
be easily configured using the provider-specific API.

> Azure ARM: Create network if it does not exist
> ----------------------------------------------
>
>                 Key: JCLOUDS-1311
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-1311
>             Project: jclouds
>          Issue Type: Improvement
>            Reporter: Graeme Miller
>
> An initial discussion was had in JCLOUDS-1308.
> Currently, when deploying a VM to Azure, a user can specify a Network and 
> Subnet by specifying a subnet resource ID (the network ID is retrieved from 
> the resource id). If this network and subnet does not exist the deployment 
> fails.
> I would like to modify the Azure Arm code to create the network if it does 
> not exist. To achieve this I propose:
> *) Modifying IpOptions so that a user can specify a NetworkName, SubnetName 
> and NetworkResourceGroup (optional, will use the groups resource group if not 
> specified)
> *) We either replace the current subnet config (which is actually a subnet 
> resource id) or we keep it and make it mutually exclusive with the above
> *) If the Network/Subnet does not exist we create it in the 
> NetworkResourceGroup specified. We would do that in the 
> normalizeNetworkOptions method 
> [here|https://github.com/jclouds/jclouds-labs/blob/master/azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/strategy/CreateResourcesThenCreateNodes.java#L219]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to