You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by "Ignasi Barrera (JIRA)" <ji...@apache.org> on 2015/09/08 22:23:45 UTC

[jira] [Commented] (JCLOUDS-987) AWS EC2: if specifying subnet ID, security groups are not created

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

Ignasi Barrera commented on JCLOUDS-987:
----------------------------------------

Looking at the code, I think that was intentional because according to the [AWS docs|http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html], when the instance is deployed in an VPC you *must* use the _securityGroupId_. I understand that this is why the previous method that sets the security groups IDs is always executed, but the method of the superclass is ignored, as it uses the security group names.

Fixing it should be as easy as performing an API call to get the IDs of all those security groups in the superclass ([here|https://github.com/jclouds/jclouds/blob/master/apis/ec2/src/main/java/org/jclouds/ec2/compute/strategy/CreateKeyPairAndSecurityGroupsAsNeededAndReturnRunOptions.java#L185]), and use always the IDs. WDYT [~rdowner]?

> AWS EC2: if specifying subnet ID, security groups are not created
> -----------------------------------------------------------------
>
>                 Key: JCLOUDS-987
>                 URL: https://issues.apache.org/jira/browse/JCLOUDS-987
>             Project: jclouds
>          Issue Type: Bug
>          Components: jclouds-compute
>    Affects Versions: 1.9.0
>            Reporter: Richard Downer
>              Labels: aws-ec2
>
> If the template options for an EC2 instance specify a subnet ID, then jclouds will not create any security groups.
> This is defined in this piece of code:
> https://github.com/jclouds/jclouds/blob/master/providers/aws-ec2/src/main/java/org/jclouds/aws/ec2/compute/strategy/CreateKeyPairPlacementAndSecurityGroupsAsNeededAndReturnRunOptions.java#L182
> The if statement checks if subnet has been set; the "false" part causes security groups to be created, but the "true" part does not - therefore if the subnet ID is set there are no security groups created.
> The workaround is for the user to define the security groups ahead of time and specify the security group IDs in the template options.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)