<%= select_f f, :flavor_id, compute_resource.flavors, :id, :to_label, {}, :label => _('Flavor') %>
<%
   arch ||= nil ; os ||= nil
   images = possible_images(compute_resource, arch, os)
%>

<div id='image_selection'><%= select_f f, :image_id, images, :uuid, :name,{:include_blank => (images.empty? || images.size == 1) ? false : _('Please select an image')}, {:disabled => images.empty?, :label => _('Image')} %></div>

<%= selectable_f f, :availability_zone, compute_resource.zones, {:include_blank => _("No preference")}, :label => _('Availability zone') %>

<div id='subnet_selection'>
<% if compute_resource.subnets.any? %>
  <%= select_f f, :subnet_id, compute_resource.subnets, :subnet_id, :cidr_block,
                {:include_blank => _("EC2")},
                {:label => _("Subnet"), :onchange => "ec2_vpcSelected(this);"} %>
<% end %>

<%
  vpc_id = compute_object_vpc_id(f)
  if ( groups = security_groups_for_vpc(compute_resource.security_groups, vpc_id)) %>
  <%= selectable_f f, :security_group_ids, groups, {},
    { :multiple => true, :label => _("Security groups"), :disabled => !(@host.nil? || @host.ip.empty?),
      :data => {
        :security_groups => vpc_security_group_hash(compute_resource.security_groups),
        :subnets => subnet_vpc_hash(compute_resource.subnets)
      },
      :class => 'security_group_ids' } %>
<% end %>

<%= selectable_f f, :managed_ip, {_("Public")=>'public', _("Private")=>'private'}, {}, { :label => _("Managed IP") } %>
</div>
