Deploying New Host to EC2 VPC

Does Foreman currently support deploying a new host to an EC2 VPC? I don't see anything under the "New Host" > "Virtual Machine" tab that would allow me to select a VPC.

Currently not. Looks like there is already a bug report.
Feature #1871: VPC support on EC2 compute - Foreman Please feel free to register and
upvote the issue.

-Brian

··· On Wed, Sep 19, 2012 at 12:56 PM, will.sterling@gmail.com wrote: > Does Foreman currently support deploying a new host to an EC2 VPC? I don't see anything under the "New Host" > "Virtual Machine" tab that would allow me to select a VPC. > > -- > You received this message because you are subscribed to the Google Groups "Foreman users" group. > To post to this group, send email to foreman-users@googlegroups.com. > To unsubscribe from this group, send email to foreman-users+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/foreman-users?hl=en. >

This ohad patch seems to work for me :

git diff app/views/compute_resources_vms/form/_ec2.html.erb
lib/foreman/model/ec2.rb
diff --git a/app/views/compute_resources_vms/form/_ec2.html.erb
b/app/views/compute_resources_vms/form
index ca9d39e…ea5c89d 100644
— a/app/views/compute_resources_vms/form/_ec2.html.erb
+++ b/app/views/compute_resources_vms/form/_ec2.html.erb
@@ -8,3 +8,6 @@
<%= selectable_f f, :groups, compute_resource.security_groups, {}, {
:multiple => true, :label => "Se
<%= selectable_f f, :availability_zone, compute_resource.zones,
{:include_blank => "No Preference"} %

+<% if (subnets = compute_resource.subnets).any? -%>

  •   &lt;%= select_f f, :subnet_id, subnets, :subnet_id, :cidr_block, {}, 
    

:label => "VPC" %>
+<% end -%>
diff --git a/lib/foreman/model/ec2.rb b/lib/foreman/model/ec2.rb
index 66123fb…41325e3 100644
— a/lib/foreman/model/ec2.rb
+++ b/lib/foreman/model/ec2.rb
@@ -1,7 +1,7 @@
module Foreman::Model
class EC2 < ComputeResource
has_one :key_pair, :foreign_key => :compute_resource_id

··· - + delegate :subnets, :to => :client validates_presence_of :user, :password after_create :setup_key_pair after_destroy :destroy_key_pair @@ -11,7 +11,7 @@ module Foreman::Model end
 def provided_attributes
  •  super.merge({ :ip => :public_ip_address })
    
  •  super.merge({ :ip => :private_ip_address })
    

    end

    def self.model_name

The line ‘+ super.merge({ :ip => :private_ip_address })’ is used
because my instances only have private IP.

Hope it’ll help. I think ohad will merge the patch after sufficient test.
Feed back appreciated :slight_smile:
Romain

Le mercredi 19 septembre 2012 19:08:58 UTC+2, Brian Gupta a écrit :

Currently not. Looks like there is already a bug report.
Feature #1871: VPC support on EC2 compute - Foreman Please feel free to register and
upvote the issue.

-Brian

On Wed, Sep 19, 2012 at 12:56 PM, will.s...@gmail.com <javascript:> > <will.s...@gmail.com <javascript:>> wrote:

Does Foreman currently support deploying a new host to an EC2 VPC? I
don’t see anything under the “New Host” > “Virtual Machine” tab that would
allow me to select a VPC.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To post to this group, send email to forema...@googlegroups.com<javascript:>.

To unsubscribe from this group, send email to
foreman-user...@googlegroups.com <javascript:>.
For more options, visit this group at
http://groups.google.com/group/foreman-users?hl=en.