https://issues.apache.org/jira/browse/JCLOUDS-1278

Allows to configure the NIC layout of a virtual machine using the template 
options. This PR removes the `virtualnetworkName` and `subnetId` from the 
`AzureTemplateOptions` class and leverages a more flexible way to configure 
networking for nodes. Configuration can be done now as follows:

* If no options are set, jclouds will create a default network and a subnet as 
it did in previous versions, allocate a private and a public ip and attach them 
to a NIC attached to the node.
* Using the portable options to specify the IDs of the subnets where the nodes 
will be attached to.
    ```java
    options.networks(subnetId2, subnetId2, ...);
    ```
    For each configured subnet, jclouds will create a NIC with a dynamically 
allocated private ip address in the subnet.
* Using the `AzureTemplateOptions` to have more control on how the ips are 
allocated. The following configurations are valid examples:
    ```java
    options.ipOptions(
       
IpOptions.builder().subnet(subnet1).address("10.0.0.5").allocatePublicIp(true).build(),
       IpOptions.builder().subnet(subnet1).allocatePublicIp(true).build(),
       IpOptions.builder().subnet(subnet2).build()
    );
    ```
    In this example, the options will create 3 NICs and attach them to the 
virtual machine. The first NIC will have a statically configured private 
address and public ip address associated, the second one will have a 
dynamically allocated private address and a public address, and the third one 
will just have a dynamically allocated private address.

I'm running the test now, but I've submitted this to have early feedback. as 
usual, comments welcome!

I'd say this is the only thing that was remaining in order to properly support 
all options in the portable abstraction. Once this is merged I'd say we are in 
a very good position to test the provider for a while and consider promoting it 
to the main repo.

/cc @andreaturli @danielestevez 
You can view, comment on, or merge this pull request online at:

  https://github.com/jclouds/jclouds-labs/pull/386

-- Commit Summary --

  * JCLOUDS-1278: Allow to configure virtual machine NICs

-- File Changes --

    M 
azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/AzureComputeProviderMetadata.java
 (4)
    M 
azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/AzureComputeServiceAdapter.java
 (145)
    M 
azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/extensions/AzureComputeSecurityGroupExtension.java
 (12)
    M 
azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/functions/VirtualMachineToNodeMetadata.java
 (16)
    M 
azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/options/AzureTemplateOptions.java
 (85)
    A 
azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/options/IpOptions.java
 (67)
    M 
azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/strategy/CleanupResources.java
 (11)
    M 
azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/compute/strategy/CreateResourcesThenCreateNodes.java
 (92)
    M 
azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/NetworkInterfaceCardProperties.java
 (37)
    M 
azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/NetworkProfile.java
 (44)
    M 
azurecompute-arm/src/main/java/org/jclouds/azurecompute/arm/domain/Subnet.java 
(74)
    M 
azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/domain/IdReferenceTest.java
 (1)
    A 
azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/domain/SubnetTest.java
 (47)
    M 
azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/LoadBalancerApiLiveTest.java
 (3)
    M 
azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/NetworkInterfaceCardApiMockTest.java
 (5)
    M 
azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/SubnetApiMockTest.java
 (2)
    M 
azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VirtualMachineApiLiveTest.java
 (11)
    M 
azurecompute-arm/src/test/java/org/jclouds/azurecompute/arm/features/VirtualMachineApiMockTest.java
 (20)

-- Patch Links --

https://github.com/jclouds/jclouds-labs/pull/386.patch
https://github.com/jclouds/jclouds-labs/pull/386.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/386

Reply via email to