<% 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 if controller_name == 'hosts' fields_enabled = true elsif controller_name == 'compute_attributes' fields_enabled = true else fields_enabled = false end -%>
VM Profile
<%= text_f f, :name, :disabled => !fields_enabled, :label => 'Name' if controller_name != 'hosts' %> <%= selectable_f f, :vcpus_max, 1..compute_resource.max_cpu_count, {}, :class => 'input-mini', :disabled => !fields_enabled, :label => 'vCPUs' %> <%= selectable_f f, :memory_min, memory_options(compute_resource.max_memory), {}, :class => 'form-control span2', :disabled => !fields_enabled, :label => 'Memory Min' %> <%= selectable_f f, :memory_max, memory_options(compute_resource.max_memory), {}, :class => 'form-control span2', :disabled => !fields_enabled, :label => 'Memory Max' %>
<%= field_set_tag 'VM Template', :id => 'xen_templates', :title => _('Template') do -%> <%= render 'compute_resources_vms/form/templates', :f => f, :compute_resource => compute_resource, :new => new %> <% 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 %>
<%= 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, :new => new %> <% 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, :new => new %> <% end -%> <% end -%>
<%= field_set_tag 'VM Startup Options', :id => 'vm_starup_options', :title => _('Power ON this VM') do -%> <%= checkbox_f f, :start, :checked => true, :label => _("Power ON this VM") %> <% end -%>