<% new = f.object hide_raw = '' if params && params['host'] && params['host']['compute_attributes'] && params['host']['compute_attributes']['custom_template_name'] != '' hide_raw = 'display:none;' end -%>
VM Profile
<%= text_f f, :name, :disabled => !new if controller_name != 'hosts' %> <%= selectable_f f, :vcpus_max, 1..compute_resource.max_cpu_count, {}, :class => 'input-mini', :disabled => !new, :label => 'vCPUs' %> <%= selectable_f f, :memory_min, memory_options(compute_resource.max_memory), {}, :class => 'span2', :disabled => !new %> <%= selectable_f f, :memory_max, memory_options(compute_resource.max_memory), {}, :class => 'span2', :disabled => !new %>
<%= field_set_tag 'VM Template', :id => 'xen_templates', :title => _('Template') do -%> <%= render 'compute_resources_vms/form/templates', :f => f, :compute_resource => compute_resource %> <% end -%>
<%= field_set_tag 'Xen Store Data', :id => 'xen_store_data', :title => _('Xen Store Data') do -%> <%= render 'compute_resources_vms/form/xenstore', :f => f, :compute_resource => compute_resource, :new => new %> <% end %>
<%= new_child_fields_template(f, :VBDs, { :object => compute_resource.new_volume, :partial => 'compute_resources_vms/form/volume', :form_builder_attrs => { :compute_resource => compute_resource } }) %> <%= field_set_tag 'Storage', :id => 'storage_volumes', :title => _('Storage') do -%> <%= f.fields_for :VBDs do |i| %> <%= render 'compute_resources_vms/form/volume', :f => i, :compute_resource => compute_resource %> <% end -%> <% end -%>
<%= field_set_tag 'Network interfaces', :id => 'network_interfaces', :title => _('Networks') do -%> <%= f.fields_for :VIFs do |i| %> <%= render 'compute_resources_vms/form/network', :f => i, :compute_resource => compute_resource %> <% end -%> <% end -%>
<% checked = params[:host] && params[:host][:compute_attributes] && params[:host][:compute_attributes][:start] || '1' %> <%= checkbox_f f, :start, { :checked => (checked == '1'), :help_inline => _('Power ON this machine') } if new %>