<%= fields_for "#{type}[compute_attributes]", @host ? @host.compute_object : compute_resource.new_vm(vm_attrs) do |compute| %>
  <% if compute.object %>
    <div id='update_not_supported' class='alert alert-info hide'><%= _("VM editing is not implemented for this provider") %></div>
    <%= render :partial => "compute_resources_vms/form/#{compute_resource.provider.downcase}",
               :locals => { :f => compute, :compute_resource => compute_resource}.merge(args_for_compute_resource_partial(@host)) %>
  <% else %>
    <div class="alert alert-block alert-danger base in fade">
      <% if @host %>
        <h4><%= _("'%{host}' not found on '%{resource}'") % { :host => @host.name, :resource => compute_resource } %></h4>
        <p><%= _("'%{host}' could be deleted or '%{resource}' is not responding.") % {:host => @host.name, :resource => compute_resource} %></p>
      <% else %>
        <h4><%= _("Failed connecting to %s") % compute_resource %></h4>
        <p><%= _("Errors: %s") % compute_resource.errors.full_messages.to_sentence %></p>
      <% end %>
    </div>
  <% end%>
  <%= hidden_field_tag 'capabilities', compute_resource.capabilities %>
  <%= content_tag(:div,'', :id => :'supports_update', :data=>{:'supports-update'=> compute_resource.supports_update? || (@host && @host.new_record?)}) %>
<% end if compute_resource %>
