Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to assign a security group to an existing instance. Is this possible?

share|improve this question
up vote 1 down vote accepted

Now you can:

In the Horizon web interface provided that you have a pretty recent version of Horizon, i.e. >= Grizzly: Change security group:

It's possible to change the security groups on the fly using Horizon, if you're using the latest release Grizzly. Click on the "More" button for the instance you want to update and you should see an "Edit Security Groups" option.

In the CLI, use nova help add-secgroup

The code for this was added a year ago so I believe this should be available in Folsom.

enter image description here

share|improve this answer

No, it isn't possible to assign a new security group to an instance that has already been started. However, changes to the rules of a security group do get propagated to running instances that belong to that group.

For example, if you launch an instance in the "default" security group, but you forgot to add the rule to allow ssh, you can add that rule to the "default" group and then you will be able to ssh to the running instance.

share|improve this answer
Thanks for your answer. Do know if there is a reason for this? – Alex Nov 16 '12 at 9:03

Create a new security group called new.

Get the id of your image (<image-id>)

select id from security_groups where name = 'new' ;
update security_group_instance_association set security_group_id=<security-group-id> where instance_id=<image-id> ;
share|improve this answer
Where are we supposed to run this query? – Franck Dernoncourt Apr 6 '13 at 2:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.