Bug 1101998

Summary: EC2 Security Groups - empty box
Product: Red Hat Satellite Reporter: Martin Korbel <mkorbel>
Component: Compute Resources - EC2Assignee: Dominic Cleal <dcleal>
Status: CLOSED NEXTRELEASE QA Contact: Kedar Bidarkar <kbidarka>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.3CC: bbuckingham, bkearney, dcleal, dlobatog, jhoblitt, jhutar, kbidarka, tcaspy, TommyTheKid
Target Milestone: UnspecifiedKeywords: Reopened, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/6535
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-09-13 17:15:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1324615    
Bug Blocks:    

Description Martin Korbel 2014-05-28 10:19:38 UTC
This is only a issue tracker. I think, this is really important to solve before release.

Description of problem:
I did not find way, how can I get security groups from Amazon EC2. I have got the box for choosing, but the box is empty. I have got tow security groups in EC2.

Version-Release number of selected component (if applicable):
Satellite-6.0.3-RHEL-6-20140521.0

(10:51:01) mkorbel: Dominic: I have next one question, how can I add a security groups into foreman.
(10:54:55) mkorbel: Dominic: When I try create new virtual machine in EC2, I see empty box of  security groups.
(10:55:52) Dominic: mkorbel: it should "just work".. I think there's a VPC dropdown too, so if you're using those you might have to select that first for them to update, otherwise I don't know

Comment 1 RHEL Program Management 2014-05-28 10:25:05 UTC
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

Comment 3 Dominic Cleal 2014-06-04 16:59:29 UTC
I can't offer any more info, it works for me.

Comment 4 Martin Korbel 2014-06-05 07:06:39 UTC
What is type of account, what  you use? I tested all this stuff on the IAM account, my account has not admin rights.

Comment 5 Dominic Cleal 2014-06-05 07:11:57 UTC
An ordinary account with admin rights, no IAM.

Comment 6 Martin Korbel 2014-06-05 07:18:50 UTC
Maybe this is the point of this problem. I can see or I can create a security groups in the web EC2 console, but I don't see them in Sat6.

Comment 7 Dominic Cleal 2014-07-09 09:57:29 UTC
Created redmine issue http://projects.theforeman.org/issues/6535 from this bug

Comment 8 Tom Caspy 2015-01-11 09:14:48 UTC
Tested this under a two conditions:
1. IAM account (in the RedHat EC2 account)
- normal security groups (no VPC) - properly shown
- VPC security groups - properly shown
2. Master account (my personal one)
- normal security groups (no VPC) - properly shown
- VPC security groups - properly shown

This may be caused by the compute resource being under a different region, where the security groups and VPCs are not defined, i.e. using us-east-1 (N. Virginia) but having the EC2 compute resource go to us-west-2 (Oregon) - in which case, a "default" security group should still be shown IMHO.

Comment 9 Tommy McNeely 2015-02-12 18:19:55 UTC
I made some comments on the redmine issue. I believe this has to do with the "initial" page load. Upon *changing* the subnet, it loads the security groups, and works fine, but if you setup your "image" exactly how you want it, then come back and try to edit it, you will see that the security groups are blank, and if you submit changes, it submits them blank.

The same thing happens at New Host -> Network... first load is blank, but if you change the subnet, they load and can be selected.

Tommy

Comment 10 Bryan Kearney 2015-08-25 17:23:35 UTC
Upstream bug component is Compute Resources

Comment 11 Bryan Kearney 2015-08-25 17:56:49 UTC
Upstream bug component is Provisioning

Comment 12 Bryan Kearney 2015-08-25 17:58:23 UTC
Upstream bug component is Compute Resources

Comment 13 Bryan Kearney 2016-01-20 15:01:02 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/6535 has been closed
-------------
Stefan Goethals
The JQuery selector in https://github.com/theforeman/foreman/blob/develop/app/assets/javascripts/compute_resource.js#L195 returns 2 elements.
The following functions don't take that into account and thus the security_groups and subnets variables are never populated.

Changing https://github.com/theforeman/foreman/blob/develop/app/assets/javascripts/compute_resource.js#L196
From
sg_select = $('.security_group_ids') 
To
sg_select = $('select.security_group_ids')

seems to resolve the issue.

-------------
Jordan Snodgrass
Stefan Goethals wrote:
> Changing https://github.com/theforeman/foreman/blob/develop/app/assets/javascripts/compute_resource.js#L196
> From
> sg_select = $('.security_group_ids') 
> To
> sg_select = $('select.security_group_ids')

I've verified that this also fixes my issue #12837 (and probably many other security-group related issues).  Will you be submitting a pull request to get this included in the next release?

-------------
Stefan Goethals
PR https://github.com/theforeman/foreman/pull/3097
-------------
Anonymous
Applied in changeset commit:062f653f53519a4704c31c297da2fca050e1234d.

Comment 16 Kedar Bidarkar 2016-04-04 20:05:24 UTC
Currently we do not have foreman-ec2 Package available for EC2 compute Resource.

TESTED with sat62-snap6

Comment 17 Kedar Bidarkar 2016-04-18 11:14:39 UTC
This issue still persists, 

We have vpc subnet defined for each of Availability zones in us-east-1.

But selecting the VPC subnet from the drop-down and then selecting the Security-Groups and submitting, does  not save the "security Group". This can be observed from editing the compute profile associated with the ec2-Compute Resource. 

Which does not show the SecurityGroup selected above under the selected items.


TESTED with sat62-snap8.1

Comment 24 errata-xmlrpc 2016-07-27 09:09:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1501

Comment 26 Bryan Kearney 2016-08-11 14:01:18 UTC
Upstream bug component is Compute Resources - EC2

Comment 27 Bryan Kearney 2017-09-13 17:15:37 UTC
Upstream is showing this as fixed. Ia m closing this out as NEXTRELEASE. If you are still seeing issues on 6.3, please feel free to re-open with additional information.