From scourtois at linagora.com Wed Sep 1 12:57:24 2010 From: scourtois at linagora.com (Simon COURTOIS) Date: Wed, 1 Sep 2010 14:57:24 +0200 Subject: [Ovirt-devel] [PATCH 1/3] Adding the VM Pool migration for vms Message-ID: <1283345844-69162-1-git-send-email-scourtois@linagora.com> Signed-off-by: Simon COURTOIS --- src/app/controllers/vm_controller.rb | 16 ++++++++++++++ src/app/views/vm/edit_vmpool.rhtml | 36 ++++++++++++++++++++++++++++++++ src/app/views/vm/show.rhtml | 3 ++ src/public/images/icon_vmpool_11px.png | Bin 0 -> 542 bytes 4 files changed, 55 insertions(+), 0 deletions(-) create mode 100644 src/app/views/vm/edit_vmpool.rhtml create mode 100644 src/public/images/icon_vmpool_11px.png diff --git a/src/app/controllers/vm_controller.rb b/src/app/controllers/vm_controller.rb index 9860843..f4a90b9 100644 --- a/src/app/controllers/vm_controller.rb +++ b/src/app/controllers/vm_controller.rb @@ -146,6 +146,22 @@ class VmController < ApplicationController render :layout => false end + def edit_vmpool + svc_modify(params[:id]) + @vm = Vm.find(params[:id]) + @vm_pools = VmResourcePool.find_all_by_parent_id(@vm.vm_resource_pool.parent.id) + render :layout => 'popup' + end + + def update_vmpool + svc_modify(params[:id]) + @vm = Vm.find(params[:id]) + @vm_pool = VmResourcePool.find(params[:vm][:vm_resource_pool_id]) + @vm.update_attribute(:vm_resource_pool, @vm_pool) + render :json => { :object => "vm", :success => true, + :alert => "VM Pool changed for this Virtual Machine" } + end + protected def _setup_provisioning_options @provisioning_options = [[Vm::PXE_OPTION_LABEL, Vm::PXE_OPTION_VALUE], diff --git a/src/app/views/vm/edit_vmpool.rhtml b/src/app/views/vm/edit_vmpool.rhtml new file mode 100644 index 0000000..cfa29a7 --- /dev/null +++ b/src/app/views/vm/edit_vmpool.rhtml @@ -0,0 +1,36 @@ +<%- content_for :title do -%> + Change VM Pool +<%- end -%> +<%- content_for :description do -%> + Please choose pool destination. +<%- end -%> + +
+
+ <%= error_messages_for 'change_vmpool' %> + + <% form_tag do %> + + <%= hidden_field_tag 'id', @vm.id, :id => 'vm_id' %> + <%= label "vm", "vm_resource_pool_id", "Select the pool to migrate to" %> + <%= select "vm", "vm_resource_pool_id", @vm_pools.map { |pool| [pool.name, pool.id] } %> + <% end %> + +
+ <%= popup_footer("$('#change_vmpool_form').submit()", "Change VM Pool") %> +
+ diff --git a/src/app/views/vm/show.rhtml b/src/app/views/vm/show.rhtml index e7207aa..3413095 100644 --- a/src/app/views/vm/show.rhtml +++ b/src/app/views/vm/show.rhtml @@ -33,6 +33,9 @@ <% end -%> <% end %> + <%= link_to image_tag("icon_vmpool_11px.png") + " Change VM Pool", + {:controller => 'vm', :action => 'edit_vmpool', :id => @vm}, + :rel=>"facebox[.bolder]", :class=>"selection_facebox" %> <%= image_tag "icon_cancel_11px.png" %> Cancel queued tasks diff --git a/src/public/images/icon_vmpool_11px.png b/src/public/images/icon_vmpool_11px.png new file mode 100644 index 0000000000000000000000000000000000000000..86e5970fcb706e5bd82882baafc4e03d7f648ee9 GIT binary patch literal 542 zcmV+(0^$9MP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igb{ z4g?!fhG5C)0%|M- z3qOj0MgD}j8p_bbLJ9Xzim8}Md82~xUv8jpta`Xr_Y=`ag2-8lPtY?$Is2* z6h($H#s#U$As^tf7 at x%?NkX^(m$mgTjE@~go1E`IHpxte(F&=w1v{Y3Vw?yuW Fix a little bug in virtio disk attributions Signed-off-by: Arthur Clement --- src/task-omatic/task_vm.rb | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/task-omatic/task_vm.rb b/src/task-omatic/task_vm.rb index 3a197f9..cf84ea2 100644 --- a/src/task-omatic/task_vm.rb +++ b/src/task-omatic/task_vm.rb @@ -66,7 +66,9 @@ def create_vm_xml(name, uuid, memAllocated, memUsed, vcpus, bootDevice, doc.root.elements["devices"].add_element("emulator").add_text("/usr/bin/qemu-kvm") devs = ['hda', 'hdb', 'hdc', 'hdd'] + virtual_devs = ['vda', 'vdb', 'vdc', 'vdd'] which_device = 0 + which_virtual_device = 0 diskDevices.each do |disk| is_cdrom = (disk =~ /\.iso/) ? true : false @@ -78,17 +80,18 @@ def create_vm_xml(name, uuid, memAllocated, memUsed, vcpus, bootDevice, diskdev.add_element("readonly") diskdev.add_element("source", {"file" => disk}) diskdev.add_element("target", {"dev" => devs[which_device], "bus" => "ide"}) + which_device += 1 elsif virtio diskdev.add_element("driver", {"name" => "qemu", "type" => "raw"}) diskdev.add_element("source", {"dev" => disk}) - diskdev.add_element("target", {"dev" => "vda", "bus" => "virtio"}) + diskdev.add_element("target", {"dev" => virtual_devs[which_virtual_device], "bus" => "virtio"}) + which_virtual_device += 1 else diskdev.add_element("source", {"dev" => disk}) diskdev.add_element("target", {"dev" => devs[which_device]}) + which_device += 1 end - doc.root.elements["devices"] << diskdev - which_device += 1 end net_interfaces.each { |nic| -- 1.7.2.2 From aclement at linagora.com Wed Sep 1 13:05:51 2010 From: aclement at linagora.com (Arthur =?iso-8859-15?q?Cl=E9ment?=) Date: Wed, 1 Sep 2010 15:05:51 +0200 Subject: [Ovirt-devel] [PATCH] Fix virtual disk name (virtio) In-Reply-To: <1283345975-626-1-git-send-email-aclement@linagora.com> References: <1283345975-626-1-git-send-email-aclement@linagora.com> Message-ID: <201009011505.51195.aclement@linagora.com> Pushed On mercredi 01 septembre 2010 14:59:35 you wrote: > Fix a little bug in virtio disk attributions > > Signed-off-by: Arthur Clement > --- > src/task-omatic/task_vm.rb | 9 ++++++--- > 1 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/src/task-omatic/task_vm.rb b/src/task-omatic/task_vm.rb > index 3a197f9..cf84ea2 100644 > --- a/src/task-omatic/task_vm.rb > +++ b/src/task-omatic/task_vm.rb > @@ -66,7 +66,9 @@ def create_vm_xml(name, uuid, memAllocated, memUsed, > vcpus, bootDevice, > doc.root.elements["devices"].add_element("emulator").add_text("/usr/bin/qe > mu-kvm") > > devs = ['hda', 'hdb', 'hdc', 'hdd'] > + virtual_devs = ['vda', 'vdb', 'vdc', 'vdd'] > which_device = 0 > + which_virtual_device = 0 > diskDevices.each do |disk| > is_cdrom = (disk =~ /\.iso/) ? true : false > > @@ -78,17 +80,18 @@ def create_vm_xml(name, uuid, memAllocated, memUsed, > vcpus, bootDevice, diskdev.add_element("readonly") > diskdev.add_element("source", {"file" => disk}) > diskdev.add_element("target", {"dev" => devs[which_device], "bus" => > "ide"}) + which_device += 1 > elsif virtio > diskdev.add_element("driver", {"name" => "qemu", "type" => "raw"}) > diskdev.add_element("source", {"dev" => disk}) > - diskdev.add_element("target", {"dev" => "vda", "bus" => "virtio"}) > + diskdev.add_element("target", {"dev" => > virtual_devs[which_virtual_device], "bus" => "virtio"}) + > which_virtual_device += 1 > else > diskdev.add_element("source", {"dev" => disk}) > diskdev.add_element("target", {"dev" => devs[which_device]}) > + which_device += 1 > end > - > doc.root.elements["devices"] << diskdev > - which_device += 1 > end > > net_interfaces.each { |nic| -- Arthur CLEMENT Linagora Paris From aclement at linagora.com Wed Sep 1 13:06:04 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Wed, 1 Sep 2010 15:06:04 +0200 Subject: [Ovirt-devel] [PATCH] Adding the ability to select a Host to start a VM In-Reply-To: <1282814243-35713-1-git-send-email-scourtois@linagora.com> References: <1282814243-35713-1-git-send-email-scourtois@linagora.com> Message-ID: <201009011506.04851.aclement@linagora.com> ACK and pushed On jeudi 26 ao?t 2010 11:17:23 Simon COURTOIS wrote: > Signed-off-by: Simon COURTOIS > --- > src/app/controllers/vm_controller.rb | 5 ++ > src/app/models/vm_task.rb | 4 +- > src/app/views/vm/start.rhtml | 77 > ++++++++++++++++++++++++++++++++++ src/task-omatic/taskomatic.rb | > 7 +++- > 4 files changed, 91 insertions(+), 2 deletions(-) > create mode 100644 src/app/views/vm/start.rhtml > > diff --git a/src/app/controllers/vm_controller.rb > b/src/app/controllers/vm_controller.rb index f4a90b9..1b77db0 100644 > --- a/src/app/controllers/vm_controller.rb > +++ b/src/app/controllers/vm_controller.rb > @@ -130,6 +130,11 @@ class VmController < ApplicationController > render :json => { :object => "vm", :success => true, :alert => alert > } end > > + def start > + @vm = Vm.find(params[:id]) > + render :layout => 'popup' > + end > + > def migrate > svc_get_for_migrate(params[:id]) > render :layout => 'popup' > diff --git a/src/app/models/vm_task.rb b/src/app/models/vm_task.rb > index 649001d..b8da529 100644 > --- a/src/app/models/vm_task.rb > +++ b/src/app/models/vm_task.rb > @@ -56,7 +56,9 @@ class VmTask < Task > > :success => Vm::STATE_RUNNING, > :failure => Vm::STATE_STOPPED, > :privilege => > :[Privilege::VM_CONTROL, > > - > PRIV_OBJECT_VM_POOL]}, + > PRIV_OBJECT_VM_POOL], + > :popup_action => 'start'}, > + > ACTION_SHUTDOWN_VM => { :label => "Shutdown", > > :icon => "icon_stop_11px.png", > :start => Vm::STATE_RUNNING, > > diff --git a/src/app/views/vm/start.rhtml b/src/app/views/vm/start.rhtml > new file mode 100644 > index 0000000..bed1d2d > --- /dev/null > +++ b/src/app/views/vm/start.rhtml > @@ -0,0 +1,77 @@ > +<%- content_for :title do -%> > + Start Virtual Machine > +<%- end -%> > +<%- content_for :description do -%> > + Please choose a Host to start the Virtual Machine. Leave the selection > blank to allow oVirt to choose the most appropriate starting host. +<%- > end -%> > +
> + > +
+
> + <%= error_messages_for 'start_vm' %> > + > + <%= render :partial => '/host/grid', :locals => { > + :table_id => 'start_vm_grid', > + :hwpool => @vm.get_hardware_pool, > + :exclude_pool => nil, > + :exclude_host => nil, > + :is_popup => true, > + :checkboxes => false, > + :on_select => 'start_vm_select', > + :on_deselect => 'start_vm_deselect', > + :on_hover => 'load_widget_hover', > + :on_unhover => 'load_widget_unhover' > + } %> > + > + <% form_tag do %> > + > + <%= hidden_field_tag 'id', @vm.id %> > + <%= hidden_field_tag 'vm_action', VmTask::ACTION_START_VM %> > + Selected Migration Target: > +
> +
> +
No starting host selected.
> +
> +
> + <%= hidden_field_tag 'vm_action_data', "" %> > + <% end %> > +
> + <%= popup_footer("$('#start_vm_form').submit()", "Start Virtual > Machine") %> +
> + > diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb > index 31c38e3..8e80115 100755 > --- a/src/task-omatic/taskomatic.rb > +++ b/src/task-omatic/taskomatic.rb > @@ -354,7 +354,12 @@ class TaskOmatic > raise "Virtual machine is currently paused, cannot start, must > resume." end > end > - db_host = find_capable_host(db_vm) > + > + if task.args > + db_host = > db_vm.vm_resource_pool.get_hardware_pool.hosts.find(task.args) + else > + db_host = find_capable_host(db_vm) > + end > > node = @qmfc.object(:class => "node", 'hostname' => db_host.hostname) -- Arthur CLEMENT Linagora Paris From aclement at linagora.com Wed Sep 1 14:19:22 2010 From: aclement at linagora.com (Arthur Clement) Date: Wed, 1 Sep 2010 16:19:22 +0200 Subject: [Ovirt-devel] [PATCH 2/2] Adding the ability to select a Host to start a VM [2/2] Message-ID: <1283350762-6308-1-git-send-email-aclement@linagora.com> Signed-off-by: Simon Courtois --- src/task-omatic/taskomatic.rb | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index 471ec88..1dfd74f 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -355,11 +355,10 @@ class TaskOmatic end end - if task.args + if task.args && !task.args.blank? db_host = db_vm.vm_resource_pool.get_hardware_pool.hosts.find(task.args) - else - db_host = find_capable_host(db_vm) end + db_host ||= find_capable_host(db_vm) node = @qmfc.object(:class => "node", 'hostname' => db_host.hostname) -- 1.7.2.2 From aclement at linagora.com Wed Sep 1 14:21:12 2010 From: aclement at linagora.com (Arthur =?iso-8859-15?q?Cl=E9ment?=) Date: Wed, 1 Sep 2010 16:21:12 +0200 Subject: [Ovirt-devel] [PATCH 2/2] Adding the ability to select a Host to start a VM [2/2] In-Reply-To: <1283350762-6308-1-git-send-email-aclement@linagora.com> References: <1283350762-6308-1-git-send-email-aclement@linagora.com> Message-ID: <201009011621.12771.aclement@linagora.com> Pushed On mercredi 01 septembre 2010 16:19:22 Arthur Clement wrote: > Signed-off-by: Simon Courtois > --- > src/task-omatic/taskomatic.rb | 5 ++--- > 1 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb > index 471ec88..1dfd74f 100755 > --- a/src/task-omatic/taskomatic.rb > +++ b/src/task-omatic/taskomatic.rb > @@ -355,11 +355,10 @@ class TaskOmatic > end > end > > - if task.args > + if task.args && !task.args.blank? > db_host = > db_vm.vm_resource_pool.get_hardware_pool.hosts.find(task.args) - else > - db_host = find_capable_host(db_vm) > end > + db_host ||= find_capable_host(db_vm) > > node = @qmfc.object(:class => "node", 'hostname' => db_host.hostname) -- Arthur CLEMENT Linagora Paris From nicolas.ochem at gmail.com Thu Sep 2 14:40:51 2010 From: nicolas.ochem at gmail.com (Nicolas Ochem) Date: Thu, 2 Sep 2010 14:40:51 +0000 Subject: [Ovirt-devel] [PATCH 1/1] Introduce an option to always pxe-boot a vm. Message-ID: <1283438451-5424-1-git-send-email-nicolas.ochem@gmail.com> Previously, a pxe-booted vm would always boot to HD at next startup. Signed-off-by: Nicolas Ochem --- src/app/controllers/vm_controller.rb | 1 + src/app/models/vm.rb | 15 +++++++++++---- src/app/views/vm/_form.rhtml | 2 +- src/task-omatic/taskomatic.rb | 13 +++++++++++-- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/app/controllers/vm_controller.rb b/src/app/controllers/vm_controller.rb index 88e13ab..8e99b67 100644 --- a/src/app/controllers/vm_controller.rb +++ b/src/app/controllers/vm_controller.rb @@ -154,6 +154,7 @@ class VmController < ApplicationController protected def _setup_provisioning_options @provisioning_options = [[Vm::PXE_OPTION_LABEL, Vm::PXE_OPTION_VALUE], + [Vm::PXE_ALWAYS_OPTION_LABEL, Vm::PXE_ALWAYS_OPTION_VALUE], [Vm::HD_OPTION_LABEL, Vm::HD_OPTION_VALUE]] begin diff --git a/src/app/models/vm.rb b/src/app/models/vm.rb index 88e0aef..885112e 100644 --- a/src/app/models/vm.rb +++ b/src/app/models/vm.rb @@ -101,8 +101,9 @@ class Vm < ActiveRecord::Base BOOT_DEV_HD = "hd" BOOT_DEV_NETWORK = "network" + BOOT_DEV_NETWORK_ALWAYS= "network_always" BOOT_DEV_CDROM = "cdrom" - BOOT_DEV_FIELDS = [ BOOT_DEV_HD, BOOT_DEV_NETWORK, BOOT_DEV_CDROM ] + BOOT_DEV_FIELDS = [ BOOT_DEV_HD, BOOT_DEV_NETWORK, BOOT_DEV_NETWORK_ALWAYS, BOOT_DEV_CDROM ] PROVISIONING_DELIMITER = ":" COBBLER_PREFIX = "cobbler" @@ -111,8 +112,10 @@ class Vm < ActiveRecord::Base COBBLER_PROFILE_SUFFIX = " (Cobbler Profile)" COBBLER_IMAGE_SUFFIX = " (Cobbler Image)" - PXE_OPTION_LABEL = "PXE Boot" + PXE_OPTION_LABEL = "PXE Boot (once)" PXE_OPTION_VALUE = "pxe" + PXE_ALWAYS_OPTION_LABEL = "PXE Boot (always)" + PXE_ALWAYS_OPTION_VALUE = "pxe_always" HD_OPTION_LABEL = "Boot from HD" HD_OPTION_VALUE = "hd" @@ -264,7 +267,9 @@ class Vm < ActiveRecord::Base end def provisioning_and_boot_settings if provisioning == nil - if boot_device==BOOT_DEV_NETWORK + if boot_device==BOOT_DEV_NETWORK_ALWAYS + PXE_ALWAYS_OPTION_VALUE + elsif boot_device==BOOT_DEV_NETWORK PXE_OPTION_VALUE elsif boot_device==BOOT_DEV_HD HD_OPTION_VALUE @@ -464,7 +469,9 @@ class Vm < ActiveRecord::Base self.storage_volumes=@storage_volumes_pending @storage_volumes_pending = [] end - errors.add("nics", "must specify at least one network if pxe booting off a network") unless boot_device != BOOT_DEV_NETWORK || nics.size > 0 + #errors.add("nics", "must specify at least one network if pxe booting off a network") unless boot_device != BOOT_DEV_NETWORK || nics.size > 0 + errors.add("nics", "must specify at least one network if pxe booting off a network") unless boot_device != BOOT_DEV_NETWORK || boot_device != BOOT_DEV_NETWORK_ALWAYS || nics.size > 0 + end diff --git a/src/app/views/vm/_form.rhtml b/src/app/views/vm/_form.rhtml index 7a46680..1ab6dda 100644 --- a/src/app/views/vm/_form.rhtml +++ b/src/app/views/vm/_form.rhtml @@ -351,7 +351,7 @@ ${htmlList(pools, id)} // only set value if we have a network to set it to and we've // selected a provision type requiring a net if(nics.length > 0 && - (e.target.value == "<%= Vm::PXE_OPTION_VALUE %>" || + (e.target.value == "<%= Vm::PXE_OPTION_VALUE %>" ||e.target.value == "<%= Vm::PXE_ALWAYS_OPTION_VALUE %>" || e.target.value.indexOf("<%= Vm::PROFILE_PREFIX %>@<%= Vm::COBBLER_PREFIX %>") == 0)){ $('#vm_network_config_select_0').val(nics[0].network_id).trigger('change'); } diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index 1dfd74f..6f699d2 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -415,9 +415,17 @@ class TaskOmatic end net_interfaces.push({ :mac => nic.mac, :interface => net_device, :virtio => nic.virtio }) } + # network_always indicates that the boot device is "network" and will not change + # upon reboot. + if db_vm.boot_device == "network_always" + boot_device = "network" + else + boot_device = db_vm.boot_device + end + xml = create_vm_xml(db_vm.description, db_vm.uuid, db_vm.memory_allocated, - db_vm.memory_used, db_vm.num_vcpus_allocated, db_vm.boot_device, + db_vm.memory_used, db_vm.num_vcpus_allocated, boot_device, db_vm.virtio, net_interfaces, storagedevs) @logger.debug("XML Domain definition: #{xml}") @@ -443,7 +451,8 @@ class TaskOmatic # This information is not available via the libvirt interface. db_vm.memory_used = db_vm.memory_allocated - db_vm.boot_device = Vm::BOOT_DEV_HD + # Revert to HD booting unless we have selected to always boot from the network. + db_vm.boot_device = Vm::BOOT_DEV_HD unless db_vm.boot_device == Vm::BOOT_DEV_NETWORK_ALWAYS db_vm.host_id = db_host.id db_vm.save! -- 1.7.2.1 From aclement at linagora.com Thu Sep 2 16:11:55 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Thu, 2 Sep 2010 18:11:55 +0200 Subject: [Ovirt-devel] [PATCH 1/1] Introduce an option to always pxe-boot a vm. In-Reply-To: <1283438451-5424-1-git-send-email-nicolas.ochem@gmail.com> References: <1283438451-5424-1-git-send-email-nicolas.ochem@gmail.com> Message-ID: <201009021811.56037.aclement@linagora.com> Tested and ACK On jeudi 02 septembre 2010 16:40:51 Nicolas Ochem wrote: > Previously, a pxe-booted vm would always boot to HD at next startup. > > Signed-off-by: Nicolas Ochem > --- > src/app/controllers/vm_controller.rb | 1 + > src/app/models/vm.rb | 15 +++++++++++---- > src/app/views/vm/_form.rhtml | 2 +- > src/task-omatic/taskomatic.rb | 13 +++++++++++-- > 4 files changed, 24 insertions(+), 7 deletions(-) > > diff --git a/src/app/controllers/vm_controller.rb > b/src/app/controllers/vm_controller.rb index 88e13ab..8e99b67 100644 > --- a/src/app/controllers/vm_controller.rb > +++ b/src/app/controllers/vm_controller.rb > @@ -154,6 +154,7 @@ class VmController < ApplicationController > protected > def _setup_provisioning_options > @provisioning_options = [[Vm::PXE_OPTION_LABEL, Vm::PXE_OPTION_VALUE], > + [Vm::PXE_ALWAYS_OPTION_LABEL, > Vm::PXE_ALWAYS_OPTION_VALUE], [Vm::HD_OPTION_LABEL, Vm::HD_OPTION_VALUE]] > > begin > diff --git a/src/app/models/vm.rb b/src/app/models/vm.rb > index 88e0aef..885112e 100644 > --- a/src/app/models/vm.rb > +++ b/src/app/models/vm.rb > @@ -101,8 +101,9 @@ class Vm < ActiveRecord::Base > > BOOT_DEV_HD = "hd" > BOOT_DEV_NETWORK = "network" > + BOOT_DEV_NETWORK_ALWAYS= "network_always" > BOOT_DEV_CDROM = "cdrom" > - BOOT_DEV_FIELDS = [ BOOT_DEV_HD, BOOT_DEV_NETWORK, BOOT_DEV_CDROM > ] + BOOT_DEV_FIELDS = [ BOOT_DEV_HD, BOOT_DEV_NETWORK, > BOOT_DEV_NETWORK_ALWAYS, BOOT_DEV_CDROM ] > > PROVISIONING_DELIMITER = ":" > COBBLER_PREFIX = "cobbler" > @@ -111,8 +112,10 @@ class Vm < ActiveRecord::Base > COBBLER_PROFILE_SUFFIX = " (Cobbler Profile)" > COBBLER_IMAGE_SUFFIX = " (Cobbler Image)" > > - PXE_OPTION_LABEL = "PXE Boot" > + PXE_OPTION_LABEL = "PXE Boot (once)" > PXE_OPTION_VALUE = "pxe" > + PXE_ALWAYS_OPTION_LABEL = "PXE Boot (always)" > + PXE_ALWAYS_OPTION_VALUE = "pxe_always" > HD_OPTION_LABEL = "Boot from HD" > HD_OPTION_VALUE = "hd" > > @@ -264,7 +267,9 @@ class Vm < ActiveRecord::Base > end > def provisioning_and_boot_settings > if provisioning == nil > - if boot_device==BOOT_DEV_NETWORK > + if boot_device==BOOT_DEV_NETWORK_ALWAYS > + PXE_ALWAYS_OPTION_VALUE > + elsif boot_device==BOOT_DEV_NETWORK > PXE_OPTION_VALUE > elsif boot_device==BOOT_DEV_HD > HD_OPTION_VALUE > @@ -464,7 +469,9 @@ class Vm < ActiveRecord::Base > self.storage_volumes=@storage_volumes_pending > @storage_volumes_pending = [] > end > - errors.add("nics", "must specify at least one network if pxe booting > off a network") unless boot_device != BOOT_DEV_NETWORK || nics.size > 0 + > #errors.add("nics", "must specify at least one network if pxe booting > off a network") unless boot_device != BOOT_DEV_NETWORK || nics.size > 0 + > errors.add("nics", "must specify at least one network if pxe booting off > a network") unless boot_device != BOOT_DEV_NETWORK || boot_device != > BOOT_DEV_NETWORK_ALWAYS || nics.size > 0 + > > end > > diff --git a/src/app/views/vm/_form.rhtml b/src/app/views/vm/_form.rhtml > index 7a46680..1ab6dda 100644 > --- a/src/app/views/vm/_form.rhtml > +++ b/src/app/views/vm/_form.rhtml > @@ -351,7 +351,7 @@ ${htmlList(pools, id)} > // only set value if we have a network to set it to and we've > // selected a provision type requiring a net > if(nics.length > 0 && > - (e.target.value == "<%= Vm::PXE_OPTION_VALUE %>" || > + (e.target.value == "<%= Vm::PXE_OPTION_VALUE %>" > ||e.target.value == "<%= Vm::PXE_ALWAYS_OPTION_VALUE %>" || > e.target.value.indexOf("<%= Vm::PROFILE_PREFIX %>@<%= Vm::COBBLER_PREFIX > %>") == 0)){ > $('#vm_network_config_select_0').val(nics[0].network_id).trigger('change') > ; } > diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb > index 1dfd74f..6f699d2 100755 > --- a/src/task-omatic/taskomatic.rb > +++ b/src/task-omatic/taskomatic.rb > @@ -415,9 +415,17 @@ class TaskOmatic > end > net_interfaces.push({ :mac => nic.mac, :interface => net_device, > :virtio => nic.virtio }) } > + # network_always indicates that the boot device is "network" and will > not change + # upon reboot. > + if db_vm.boot_device == "network_always" > + boot_device = "network" > + else > + boot_device = db_vm.boot_device > + end > + > > xml = create_vm_xml(db_vm.description, db_vm.uuid, > db_vm.memory_allocated, - db_vm.memory_used, > db_vm.num_vcpus_allocated, db_vm.boot_device, + > db_vm.memory_used, db_vm.num_vcpus_allocated, boot_device, db_vm.virtio, > net_interfaces, storagedevs) > > @logger.debug("XML Domain definition: #{xml}") > @@ -443,7 +451,8 @@ class TaskOmatic > > # This information is not available via the libvirt interface. > db_vm.memory_used = db_vm.memory_allocated > - db_vm.boot_device = Vm::BOOT_DEV_HD > + # Revert to HD booting unless we have selected to always boot from the > network. + db_vm.boot_device = Vm::BOOT_DEV_HD unless db_vm.boot_device > == Vm::BOOT_DEV_NETWORK_ALWAYS db_vm.host_id = db_host.id > db_vm.save! -- Arthur CLEMENT Linagora Paris From scourtois at linagora.com Fri Sep 3 08:43:11 2010 From: scourtois at linagora.com (Simon COURTOIS) Date: Fri, 3 Sep 2010 10:43:11 +0200 Subject: [Ovirt-devel] [PATCH] Adding some control over usages in the network creation/edition form Message-ID: <1283503391-774-1-git-send-email-scourtois@linagora.com> Signed-off-by: Simon COURTOIS --- src/app/controllers/usages_controller.rb | 13 +++++++ src/app/models/usage.rb | 2 +- src/app/services/usage_service.rb | 23 ++++++++++++ src/app/views/network/_form.rhtml | 56 +++++++++++++++++++++++++++++- src/config/routes.rb | 1 + src/public/stylesheets/components.css | 18 +++++++++ 6 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 src/app/controllers/usages_controller.rb create mode 100644 src/app/services/usage_service.rb diff --git a/src/app/controllers/usages_controller.rb b/src/app/controllers/usages_controller.rb new file mode 100644 index 0000000..0da324e --- /dev/null +++ b/src/app/controllers/usages_controller.rb @@ -0,0 +1,13 @@ +class UsagesController < ApplicationController + include UsageService + + def create + usage = svc_create(params[:usage]) + render :json => { :success => true, :data => usage } + end + + def remove + removed_ids = svc_destroy_all(params[:ids]) + render :json => { :success => true, :removed => removed_ids } + end +end diff --git a/src/app/models/usage.rb b/src/app/models/usage.rb index 59b0e48..883a888 100644 --- a/src/app/models/usage.rb +++ b/src/app/models/usage.rb @@ -22,6 +22,6 @@ class Usage < ActiveRecord::Base validates_presence_of :label validates_presence_of :usage - validates_uniqueness_of :usage + # validates_uniqueness_of :usage end diff --git a/src/app/services/usage_service.rb b/src/app/services/usage_service.rb new file mode 100644 index 0000000..d044631 --- /dev/null +++ b/src/app/services/usage_service.rb @@ -0,0 +1,23 @@ +module UsageService + include ApplicationService + + def authorize + authorized!(Privilege::MODIFY,HardwarePool.get_default_pool) + end + + def svc_create(usage_hash) + authorize + usage_hash[:id] = Usage.maximum(:id) + 1 + @usage = Usage.new(usage_hash) + @usage.save! + return @usage + end + + def svc_destroy_all(ids) + authorize + # prevent destruction of original usages (1, 2 and 3) + ids -= ['1','2','3'] + Usage.destroy(ids) + return ids + end +end diff --git a/src/app/views/network/_form.rhtml b/src/app/views/network/_form.rhtml index 6c67a0e..d04e450 100644 --- a/src/app/views/network/_form.rhtml +++ b/src/app/views/network/_form.rhtml @@ -18,11 +18,20 @@
Usage:
-
+
+
+

+ <%= text_field_tag 'network_usage_label', nil, :class => 'textfield_effect' %> + +

+

+ +

+
0) { + $.post( + "<%= usages_path :format => 'json' %>", + { + "usage[label]": label, + "usage[usage]": 'management' + }, + function(data, status) { + if (data.success) { + var usage = data.data.usage; + $('#network_usages_ids') + .append(''); + } + }, + 'json' + ); + } + return false; +}); + +$('#delete_usages').click(function() { + var selected_ids = $('#network_usages_ids').val(); + + $.post( + "<%= remove_usages_path :format => 'json' %>", + { + '_method': 'delete', + 'ids[]': selected_ids + }, + function(data, status) { + if (data.success) { + for (id in data.removed) { + $('#network_usages_ids') + .find('option:selected[value='+data.removed[id]+']') + .remove(); + } + } + }, + 'json' + ); + return false; +}); diff --git a/src/config/routes.rb b/src/config/routes.rb index 795f022..70fe614 100644 --- a/src/config/routes.rb +++ b/src/config/routes.rb @@ -58,4 +58,5 @@ ActionController::Routing::Routes.draw do |map| hardware_pools.resources :storage_pools, :controller => 'storage' end map.resources :vms, :controller => 'vm' + map.resources :usages, :only => [ :create ], :collection => { :remove => :delete } end diff --git a/src/public/stylesheets/components.css b/src/public/stylesheets/components.css index 70cda97..3cdbf49 100644 --- a/src/public/stylesheets/components.css +++ b/src/public/stylesheets/components.css @@ -394,3 +394,21 @@ #vm_network_config_add:hover { cursor: pointer; } + +#network_usages_infos { + overflow: hidden; + width: 100%; +} + +#network_usages_infos select { + float: left; +} + +#network_usages_infos .usage_buttons { + float: left; + margin-left: 1em; +} + +#network_usages_infos .usage_buttons p { + margin-top: 0; +} -- 1.7.2.1 From aclement at linagora.com Tue Sep 7 07:24:25 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Tue, 7 Sep 2010 09:24:25 +0200 Subject: [Ovirt-devel] [PATCH 1/1] Introduce an option to always pxe-boot a vm. In-Reply-To: <201009021811.56037.aclement@linagora.com> References: <1283438451-5424-1-git-send-email-nicolas.ochem@gmail.com> <201009021811.56037.aclement@linagora.com> Message-ID: <201009070924.25642.aclement@linagora.com> Pushed On jeudi 02 septembre 2010 18:11:55 Arthur Cl?ment wrote: > Tested and ACK > > On jeudi 02 septembre 2010 16:40:51 Nicolas Ochem wrote: > > Previously, a pxe-booted vm would always boot to HD at next startup. > > > > Signed-off-by: Nicolas Ochem > > --- > > > > src/app/controllers/vm_controller.rb | 1 + > > src/app/models/vm.rb | 15 +++++++++++---- > > src/app/views/vm/_form.rhtml | 2 +- > > src/task-omatic/taskomatic.rb | 13 +++++++++++-- > > 4 files changed, 24 insertions(+), 7 deletions(-) > > > > diff --git a/src/app/controllers/vm_controller.rb > > b/src/app/controllers/vm_controller.rb index 88e13ab..8e99b67 100644 > > --- a/src/app/controllers/vm_controller.rb > > +++ b/src/app/controllers/vm_controller.rb > > @@ -154,6 +154,7 @@ class VmController < ApplicationController > > > > protected > > def _setup_provisioning_options > > > > @provisioning_options = [[Vm::PXE_OPTION_LABEL, > > Vm::PXE_OPTION_VALUE], > > > > + [Vm::PXE_ALWAYS_OPTION_LABEL, > > Vm::PXE_ALWAYS_OPTION_VALUE], [Vm::HD_OPTION_LABEL, Vm::HD_OPTION_VALUE]] > > > > begin > > > > diff --git a/src/app/models/vm.rb b/src/app/models/vm.rb > > index 88e0aef..885112e 100644 > > --- a/src/app/models/vm.rb > > +++ b/src/app/models/vm.rb > > @@ -101,8 +101,9 @@ class Vm < ActiveRecord::Base > > > > BOOT_DEV_HD = "hd" > > BOOT_DEV_NETWORK = "network" > > > > + BOOT_DEV_NETWORK_ALWAYS= "network_always" > > > > BOOT_DEV_CDROM = "cdrom" > > > > - BOOT_DEV_FIELDS = [ BOOT_DEV_HD, BOOT_DEV_NETWORK, > > BOOT_DEV_CDROM ] + BOOT_DEV_FIELDS = [ BOOT_DEV_HD, > > BOOT_DEV_NETWORK, > > BOOT_DEV_NETWORK_ALWAYS, BOOT_DEV_CDROM ] > > > > PROVISIONING_DELIMITER = ":" > > COBBLER_PREFIX = "cobbler" > > > > @@ -111,8 +112,10 @@ class Vm < ActiveRecord::Base > > > > COBBLER_PROFILE_SUFFIX = " (Cobbler Profile)" > > COBBLER_IMAGE_SUFFIX = " (Cobbler Image)" > > > > - PXE_OPTION_LABEL = "PXE Boot" > > + PXE_OPTION_LABEL = "PXE Boot (once)" > > > > PXE_OPTION_VALUE = "pxe" > > > > + PXE_ALWAYS_OPTION_LABEL = "PXE Boot (always)" > > + PXE_ALWAYS_OPTION_VALUE = "pxe_always" > > > > HD_OPTION_LABEL = "Boot from HD" > > HD_OPTION_VALUE = "hd" > > > > @@ -264,7 +267,9 @@ class Vm < ActiveRecord::Base > > > > end > > def provisioning_and_boot_settings > > > > if provisioning == nil > > > > - if boot_device==BOOT_DEV_NETWORK > > + if boot_device==BOOT_DEV_NETWORK_ALWAYS > > + PXE_ALWAYS_OPTION_VALUE > > + elsif boot_device==BOOT_DEV_NETWORK > > > > PXE_OPTION_VALUE > > > > elsif boot_device==BOOT_DEV_HD > > > > HD_OPTION_VALUE > > > > @@ -464,7 +469,9 @@ class Vm < ActiveRecord::Base > > > > self.storage_volumes=@storage_volumes_pending > > @storage_volumes_pending = [] > > > > end > > > > - errors.add("nics", "must specify at least one network if pxe booting > > off a network") unless boot_device != BOOT_DEV_NETWORK || nics.size > 0 + > > > > #errors.add("nics", "must specify at least one network if pxe booting > > > > off a network") unless boot_device != BOOT_DEV_NETWORK || nics.size > 0 + > > > > errors.add("nics", "must specify at least one network if pxe booting > > off > > > > a network") unless boot_device != BOOT_DEV_NETWORK || boot_device != > > BOOT_DEV_NETWORK_ALWAYS || nics.size > 0 + > > > > end > > > > diff --git a/src/app/views/vm/_form.rhtml b/src/app/views/vm/_form.rhtml > > index 7a46680..1ab6dda 100644 > > --- a/src/app/views/vm/_form.rhtml > > +++ b/src/app/views/vm/_form.rhtml > > @@ -351,7 +351,7 @@ ${htmlList(pools, id)} > > > > // only set value if we have a network to set it to and we've > > // selected a provision type requiring a net > > if(nics.length > 0 && > > > > - (e.target.value == "<%= Vm::PXE_OPTION_VALUE %>" || > > + (e.target.value == "<%= Vm::PXE_OPTION_VALUE %>" > > > > ||e.target.value == "<%= Vm::PXE_ALWAYS_OPTION_VALUE %>" || > > > > e.target.value.indexOf("<%= Vm::PROFILE_PREFIX %>@<%= Vm::COBBLER_PREFIX > > %>") == 0)){ > > $('#vm_network_config_select_0').val(nics[0].network_id).trigger('change' > > ) ; } > > diff --git a/src/task-omatic/taskomatic.rb > > b/src/task-omatic/taskomatic.rb index 1dfd74f..6f699d2 100755 > > --- a/src/task-omatic/taskomatic.rb > > +++ b/src/task-omatic/taskomatic.rb > > @@ -415,9 +415,17 @@ class TaskOmatic > > > > end > > net_interfaces.push({ :mac => nic.mac, :interface => net_device, > > : > > :virtio => nic.virtio }) } > > > > + # network_always indicates that the boot device is "network" and > > will not change + # upon reboot. > > + if db_vm.boot_device == "network_always" > > + boot_device = "network" > > + else > > + boot_device = db_vm.boot_device > > + end > > + > > > > xml = create_vm_xml(db_vm.description, db_vm.uuid, > > > > db_vm.memory_allocated, - db_vm.memory_used, > > db_vm.num_vcpus_allocated, db_vm.boot_device, + > > db_vm.memory_used, db_vm.num_vcpus_allocated, boot_device, db_vm.virtio, > > net_interfaces, storagedevs) > > > > @logger.debug("XML Domain definition: #{xml}") > > > > @@ -443,7 +451,8 @@ class TaskOmatic > > > > # This information is not available via the libvirt interface. > > db_vm.memory_used = db_vm.memory_allocated > > > > - db_vm.boot_device = Vm::BOOT_DEV_HD > > + # Revert to HD booting unless we have selected to always boot from > > the network. + db_vm.boot_device = Vm::BOOT_DEV_HD unless > > db_vm.boot_device == Vm::BOOT_DEV_NETWORK_ALWAYS db_vm.host_id = > > db_host.id > > > > db_vm.save! -- Arthur CLEMENT Linagora Paris From aclement at linagora.com Wed Sep 8 12:57:26 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Wed, 8 Sep 2010 14:57:26 +0200 Subject: [Ovirt-devel] [PATCH 1/3] Adding the VM Pool migration for vms In-Reply-To: <1283345844-69162-1-git-send-email-scourtois@linagora.com> References: <1283345844-69162-1-git-send-email-scourtois@linagora.com> Message-ID: <201009081457.26616.aclement@linagora.com> ack & pushed On mercredi 01 septembre 2010 14:57:24 Simon COURTOIS wrote: > Signed-off-by: Simon COURTOIS > --- > src/app/controllers/vm_controller.rb | 16 ++++++++++++++ > src/app/views/vm/edit_vmpool.rhtml | 36 > ++++++++++++++++++++++++++++++++ src/app/views/vm/show.rhtml | > 3 ++ > src/public/images/icon_vmpool_11px.png | Bin 0 -> 542 bytes > 4 files changed, 55 insertions(+), 0 deletions(-) > create mode 100644 src/app/views/vm/edit_vmpool.rhtml > create mode 100644 src/public/images/icon_vmpool_11px.png > > diff --git a/src/app/controllers/vm_controller.rb > b/src/app/controllers/vm_controller.rb index 9860843..f4a90b9 100644 > --- a/src/app/controllers/vm_controller.rb > +++ b/src/app/controllers/vm_controller.rb > @@ -146,6 +146,22 @@ class VmController < ApplicationController > render :layout => false > end > > + def edit_vmpool > + svc_modify(params[:id]) > + @vm = Vm.find(params[:id]) > + @vm_pools = > VmResourcePool.find_all_by_parent_id(@vm.vm_resource_pool.parent.id) + > render :layout => 'popup' > + end > + > + def update_vmpool > + svc_modify(params[:id]) > + @vm = Vm.find(params[:id]) > + @vm_pool = VmResourcePool.find(params[:vm][:vm_resource_pool_id]) > + @vm.update_attribute(:vm_resource_pool, @vm_pool) > + render :json => { :object => "vm", :success => true, > + :alert => "VM Pool changed for this Virtual Machine" > } + end > + > protected > def _setup_provisioning_options > @provisioning_options = [[Vm::PXE_OPTION_LABEL, Vm::PXE_OPTION_VALUE], > diff --git a/src/app/views/vm/edit_vmpool.rhtml > b/src/app/views/vm/edit_vmpool.rhtml new file mode 100644 > index 0000000..cfa29a7 > --- /dev/null > +++ b/src/app/views/vm/edit_vmpool.rhtml > @@ -0,0 +1,36 @@ > +<%- content_for :title do -%> > + Change VM Pool > +<%- end -%> > +<%- content_for :description do -%> > + Please choose pool destination. > +<%- end -%> > + > +
+
> + <%= error_messages_for 'change_vmpool' %> > + > + <% form_tag do %> > + > + <%= hidden_field_tag 'id', @vm.id, :id => 'vm_id' %> > + <%= label "vm", "vm_resource_pool_id", "Select the pool to migrate > to" %> + <%= select "vm", "vm_resource_pool_id", @vm_pools.map { > |pool| [pool.name, pool.id] } %> + <% end %> > + > +
> + <%= popup_footer("$('#change_vmpool_form').submit()", "Change VM Pool") > %> +
> + > diff --git a/src/app/views/vm/show.rhtml b/src/app/views/vm/show.rhtml > index e7207aa..3413095 100644 > --- a/src/app/views/vm/show.rhtml > +++ b/src/app/views/vm/show.rhtml > @@ -33,6 +33,9 @@ > > <% end -%> > <% end %> > + <%= link_to image_tag("icon_vmpool_11px.png") + " Change VM Pool", > + {:controller => 'vm', :action => 'edit_vmpool', > :id => @vm}, + :rel=>"facebox[.bolder]", :class=>"selection_facebox" > %> > > <%= image_tag "icon_cancel_11px.png" %> Cancel queued tasks > > diff --git a/src/public/images/icon_vmpool_11px.png > b/src/public/images/icon_vmpool_11px.png new file mode 100644 > index > 0000000000000000000000000000000000000000..86e5970fcb706e5bd82882baafc4e03d > 7f648ee9 GIT binary patch > literal 542 > zcmV+(0^$9MP) z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igb{ > z4g?!fhG5C)0%|M- > z3qOj0MgD z_;`W;As)=%nwY)PT(4C3Vbm^5FJDi;SYG)sOn&wJ3DTAB`nk(z at oLM9s3DGw9bLV5 > z|1Ls^JuwVJI-T~~wVU&2q}G`QOX<7_vt4YljdKdYUf}VFour%^KR!7sbL+usT%IDM > zfZpH`f8qoo1lE>}j8p_bbLJ9Xzim8}Md82~xUv8jpta`Xr_Y=`ag2-8lPtY?$Is2* > z6h($H#s#U$As^tf7 at x%?NkX^(m$mgTjE@~go1E`IHpxte(F&=w1v{Y3Vw?yuW zwy2F(nVPxHPLksB#BoAa zezvo%t_GpB&cVTYMWm at tqbNF6tJNj|y4~)xs2UyU_4<#*ut7KG=1w;njXU*vy--St > gPP=Vdt=0m-KfYwn??4I``~Uy|07*qoM6N<$f<@--od5s; > > literal 0 > HcmV?d00001 -- Arthur CLEMENT Linagora Paris From aclement at linagora.com Wed Sep 8 13:14:19 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Wed, 8 Sep 2010 15:14:19 +0200 Subject: [Ovirt-devel] [PATCH] Adding some control over usages in the network creation/edition form In-Reply-To: <1283503391-774-1-git-send-email-scourtois@linagora.com> References: <1283503391-774-1-git-send-email-scourtois@linagora.com> Message-ID: <201009081514.19546.aclement@linagora.com> Pushed On vendredi 03 septembre 2010 10:43:11 Simon COURTOIS wrote: > Signed-off-by: Simon COURTOIS > --- > src/app/controllers/usages_controller.rb | 13 +++++++ > src/app/models/usage.rb | 2 +- > src/app/services/usage_service.rb | 23 ++++++++++++ > src/app/views/network/_form.rhtml | 56 > +++++++++++++++++++++++++++++- src/config/routes.rb | > 1 + > src/public/stylesheets/components.css | 18 +++++++++ > 6 files changed, 111 insertions(+), 2 deletions(-) > create mode 100644 src/app/controllers/usages_controller.rb > create mode 100644 src/app/services/usage_service.rb > > diff --git a/src/app/controllers/usages_controller.rb > b/src/app/controllers/usages_controller.rb new file mode 100644 > index 0000000..0da324e > --- /dev/null > +++ b/src/app/controllers/usages_controller.rb > @@ -0,0 +1,13 @@ > +class UsagesController < ApplicationController > + include UsageService > + > + def create > + usage = svc_create(params[:usage]) > + render :json => { :success => true, :data => usage } > + end > + > + def remove > + removed_ids = svc_destroy_all(params[:ids]) > + render :json => { :success => true, :removed => removed_ids } > + end > +end > diff --git a/src/app/models/usage.rb b/src/app/models/usage.rb > index 59b0e48..883a888 100644 > --- a/src/app/models/usage.rb > +++ b/src/app/models/usage.rb > @@ -22,6 +22,6 @@ class Usage < ActiveRecord::Base > validates_presence_of :label > validates_presence_of :usage > > - validates_uniqueness_of :usage > + # validates_uniqueness_of :usage > > end > diff --git a/src/app/services/usage_service.rb > b/src/app/services/usage_service.rb new file mode 100644 > index 0000000..d044631 > --- /dev/null > +++ b/src/app/services/usage_service.rb > @@ -0,0 +1,23 @@ > +module UsageService > + include ApplicationService > + > + def authorize > + authorized!(Privilege::MODIFY,HardwarePool.get_default_pool) > + end > + > + def svc_create(usage_hash) > + authorize > + usage_hash[:id] = Usage.maximum(:id) + 1 > + @usage = Usage.new(usage_hash) > + @usage.save! > + return @usage > + end > + > + def svc_destroy_all(ids) > + authorize > + # prevent destruction of original usages (1, 2 and 3) > + ids -= ['1','2','3'] > + Usage.destroy(ids) > + return ids > + end > +end > diff --git a/src/app/views/network/_form.rhtml > b/src/app/views/network/_form.rhtml index 6c67a0e..d04e450 100644 > --- a/src/app/views/network/_form.rhtml > +++ b/src/app/views/network/_form.rhtml > @@ -18,11 +18,20 @@ > > >
Usage:
> -
> +
> > +
> +

> + <%= text_field_tag 'network_usage_label', nil, :class => > 'textfield_effect' %> + > +

> +

> + > +

> +
>
> >
@@ -43,4 +52,49 @@ $("#network_type").change(function () { > $("#vlan_options").hide(); > } > }).trigger('change'); > + > +$('#add_usage').click(function() { > + var label = $('#network_usage_label').val(); > + if (label.length > 0) { > + $.post( > + "<%= usages_path :format => 'json' %>", > + { > + "usage[label]": label, > + "usage[usage]": 'management' > + }, > + function(data, status) { > + if (data.success) { > + var usage = data.data.usage; > + $('#network_usages_ids') > + .append(''); + } > + }, > + 'json' > + ); > + } > + return false; > +}); > + > +$('#delete_usages').click(function() { > + var selected_ids = $('#network_usages_ids').val(); > + > + $.post( > + "<%= remove_usages_path :format => 'json' %>", > + { > + '_method': 'delete', > + 'ids[]': selected_ids > + }, > + function(data, status) { > + if (data.success) { > + for (id in data.removed) { > + $('#network_usages_ids') > + .find('option:selected[value='+data.removed[id]+']') > + .remove(); > + } > + } > + }, > + 'json' > + ); > + return false; > +}); > > diff --git a/src/config/routes.rb b/src/config/routes.rb > index 795f022..70fe614 100644 > --- a/src/config/routes.rb > +++ b/src/config/routes.rb > @@ -58,4 +58,5 @@ ActionController::Routing::Routes.draw do |map| > hardware_pools.resources :storage_pools, :controller => 'storage' > end > map.resources :vms, :controller => 'vm' > + map.resources :usages, :only => [ :create ], :collection => { :remove => > :delete } end > diff --git a/src/public/stylesheets/components.css > b/src/public/stylesheets/components.css index 70cda97..3cdbf49 100644 > --- a/src/public/stylesheets/components.css > +++ b/src/public/stylesheets/components.css > @@ -394,3 +394,21 @@ > #vm_network_config_add:hover { > cursor: pointer; > } > + > +#network_usages_infos { > + overflow: hidden; > + width: 100%; > +} > + > +#network_usages_infos select { > + float: left; > +} > + > +#network_usages_infos .usage_buttons { > + float: left; > + margin-left: 1em; > +} > + > +#network_usages_infos .usage_buttons p { > + margin-top: 0; > +} -- Arthur CLEMENT Linagora Paris From lathama at gmail.com Wed Sep 8 14:30:09 2010 From: lathama at gmail.com (Andrew Latham) Date: Wed, 8 Sep 2010 10:30:09 -0400 Subject: [Ovirt-devel] OVIRT on other platforms. Message-ID: I am looking at testing OVIRT for services and have some input for the development. I have noticed that the websites for the project have various information on different sites. I have the GIT pull from today and will look at it from a fresh user point of view. Are there any additional documentation efforts that are not connected with the existing websites or source code that I should address? ~ Andrew "lathama" Latham lathama at gmail.com * Learn more about OSS http://en.wikipedia.org/wiki/Open-source_software * Learn more about Linux http://en.wikipedia.org/wiki/Linux * Learn more about Tux http://en.wikipedia.org/wiki/Tux From aclement at linagora.com Wed Sep 8 15:18:40 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Wed, 8 Sep 2010 17:18:40 +0200 Subject: [Ovirt-devel] OVIRT on other platforms. In-Reply-To: References: Message-ID: <201009081718.40710.aclement@linagora.com> Hi, The most of the doc is available on https://fedorahosted.org/ovirt/. Currently, the compilation from the git repo is the only way to install ovirt on fedora 13. It can be a bit complicated, so feel free to ask questions here or on #ovirt at oftc.net. -- Arthur CLEMENT Linagora Paris On mercredi 08 septembre 2010 16:30:09 Andrew Latham wrote: > I am looking at testing OVIRT for services and have some input for the > development. I have noticed that the websites for the project have > various information on different sites. I have the GIT pull from > today and will look at it from a fresh user point of view. > > Are there any additional documentation efforts that are not connected > with the existing websites or source code that I should address? > > > ~ > Andrew "lathama" Latham > lathama at gmail.com > > * Learn more about OSS http://en.wikipedia.org/wiki/Open-source_software > * Learn more about Linux http://en.wikipedia.org/wiki/Linux > * Learn more about Tux http://en.wikipedia.org/wiki/Tux > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel From lathama at gmail.com Wed Sep 8 15:28:10 2010 From: lathama at gmail.com (Andrew Latham) Date: Wed, 8 Sep 2010 11:28:10 -0400 Subject: [Ovirt-devel] OVIRT on other platforms. In-Reply-To: <201009081718.40710.aclement@linagora.com> References: <201009081718.40710.aclement@linagora.com> Message-ID: Thank you, I have reviewed that documentation. I will be working on Debian Squeeze/Lenny and am happy to do the install. My initial concern was the multiple websites and missing "doc" directory in the source. I would suggest adding a "doc" directory to the source tree where documentation and references can be noted. As an internal process, we do not use any technology that only works on a single platform. ~ Andrew "lathama" Latham lathama at gmail.com * Learn more about OSS http://en.wikipedia.org/wiki/Open-source_software * Learn more about Linux http://en.wikipedia.org/wiki/Linux * Learn more about Tux http://en.wikipedia.org/wiki/Tux On Wed, Sep 8, 2010 at 11:18 AM, Arthur Cl?ment wrote: > Hi, > > The most of the doc is available on https://fedorahosted.org/ovirt/. > Currently, the compilation from the git repo is the only way to install ovirt > on fedora 13. It can be a bit complicated, so feel free to ask questions here > or on #ovirt at oftc.net. > > > -- > Arthur CLEMENT > Linagora Paris > > On mercredi 08 septembre 2010 16:30:09 Andrew Latham wrote: >> I am looking at testing OVIRT for services and have some input for the >> development. ?I have noticed that the websites for the project have >> various information on different sites. ?I have the GIT pull from >> today and will look at it from a fresh user point of view. >> >> Are there any additional documentation efforts that are not connected >> with the existing websites or source code that I should address? >> >> >> ~ >> Andrew "lathama" Latham >> lathama at gmail.com >> >> * Learn more about OSS http://en.wikipedia.org/wiki/Open-source_software >> * Learn more about Linux http://en.wikipedia.org/wiki/Linux >> * Learn more about Tux http://en.wikipedia.org/wiki/Tux >> >> _______________________________________________ >> Ovirt-devel mailing list >> Ovirt-devel at redhat.com >> https://www.redhat.com/mailman/listinfo/ovirt-devel > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > From apevec at gmail.com Wed Sep 8 20:05:09 2010 From: apevec at gmail.com (Alan Pevec) Date: Wed, 8 Sep 2010 22:05:09 +0200 Subject: [Ovirt-devel] OVIRT on other platforms. In-Reply-To: References: <201009081718.40710.aclement@linagora.com> Message-ID: On Wed, Sep 8, 2010 at 5:28 PM, Andrew Latham wrote: > Thank you, I have reviewed that documentation. ?I will be working on > Debian Squeeze/Lenny and am happy to do the install. ?My initial > concern was the multiple websites and missing "doc" directory in the > source. ?I would suggest adding a "doc" directory to the source tree > where documentation and references can be noted. There are docs in docbook format in http://git.fedorahosted.org/git/ovirt/?p=ovirt/docs.git;a=summary - that was when we had separate ovirt-docs RPM and one git per SRPM policy. I think we can import it as "doc" directory in ovirt/server git and deprecated separate docs git, to make it easier to keep docs current. Alan From justin at redfish.com.au Thu Sep 9 14:35:38 2010 From: justin at redfish.com.au (Justin Clacherty) Date: Fri, 10 Sep 2010 00:35:38 +1000 Subject: [Ovirt-devel] Provisioning Windows Message-ID: <4C88F0BA.6040405@redfish.com.au> How do I go about provisioning a windows VM? I've added the iso to cobbler using the following command. cobbler image add --name=W2k8Prov --file=nfs://192.168.50.190/ovirt/w2k8.iso The image then appears in the list of Operating Systems to choose when creating a VM. I select the image when I create the VM but then when I go to save I get the error: undefined method `keys' for "~":String How are people provisioning Windows VMs? Cheers, Justin. From justin at redfish.com.au Fri Sep 10 05:55:43 2010 From: justin at redfish.com.au (Justin Clacherty) Date: Fri, 10 Sep 2010 15:55:43 +1000 Subject: [Ovirt-devel] Provisioning Windows In-Reply-To: <4C88F0BA.6040405@redfish.com.au> References: <4C88F0BA.6040405@redfish.com.au> Message-ID: <000c01cb50ac$ce12b2c0$6a381840$@redfish.com.au> > How do I go about provisioning a windows VM? I've added the iso to > cobbler using the following command. > > cobbler image add --name=W2k8Prov -- > file=nfs://192.168.50.190/ovirt/w2k8.iso > > The image then appears in the list of Operating Systems to choose when > creating a VM. I select the image when I create the VM but then when I go > to save I get the error: > > undefined method `keys' for "~":String > > How are people provisioning Windows VMs? > My guess is that people don't. I've spent a bit of time on this today and have managed to get a VM booting using an installation ISO. It seems there's some problems with cobbler (or how it's used). I'm still having problems though so bear with me. The problem with installing off ISOs are two-fold. 1) Provisioning the VM fails because Cobbler::System.find_one() does not behave as expected. 2) The xml sent to libvirtd on the node is incorrect. Provisioning Windows Server 2008 R2 is still a problem once this is resolved. This is seemingly because the version of KVM on the node doesn't work with W2k8R2. Here's the first two problems which I've managed to work around. I hope this a) helps out anyone else trying to install off an ISO, and b) helps the developers fix the issue which as far as I can tell from the mailing list has been around for a while. This is the error I was seeing in rails.log Processing VmController#update (for 192.168.42.111 at 2010-09-10 01:57:16) [POST] Parameters: {"vm"=>{"nics"=>"#", "provisioning_and_boot_settings"=>"image at cobbler:W2k8Prov", "storage_volume_ids"=>["16"], "vm_resource_pool_id"=>"5", "uuid"=>"59048cfa-d91d-bb65-27b2-edfc5e863d79", "description"=>"Exchange2010", "memory_allocated_in_mb"=>"4096", "num_vcpus_allocated"=>"4"}, "id"=>"8", "macs"=>["00:16:3e:76:7b:36", ""], "networks"=>["1", ""]} NoMethodError (undefined method `keys' for "~":String): (eval):9:in `find_one' app/services/vm_service.rb:297:in `vm_provision' app/services/vm_service.rb:169:in `svc_update' app/services/vm_service.rb:160:in `svc_update' app/controllers/vm_controller.rb:81:in `update' The line in vm_provision is System = Cobbler::System.find_one(name) Looking at the code around it I'm guessing that the author assumed that Cobbler::System.find_one() would return null (or is it nil in ruby?) if the system wasn't found in cobbler. It seems that what actually happens is that some exception is thrown (or whatever the ruby equivalent to an exception is) instead so everything failed. Not knowing ruby at all and knowing that the system wasn't there I just commented out the check and let it simply add the system. That allowed the VM settings to be saved and the VM was created in the user interface. I then put the code that I commented out back in to see if find_one would still be a problem. Wasn't a problem anymore, could edit the VM and everything which is why I'm assuming that the assumptions about what find_one does when the system isn't in cobbler are incorrect. Now when you boot the VM it tries to boot of the cdrom as you'd expect only it can't actually find the cdrom. I logged on to the node and did a dump of the xml for the vm. The OS was set to boot off cdrom as expected, however, there's no cdrom entry in there at all. The ISO is described as a "disk". To get around this I: - started the VM - logged in to the node running the VM - dumped the xml for the VM to a file - in the disk entry for the ISO I changed to - destroyed the running VM - created the VM from the edited xml file The VM boots, finds the cdrom and does its thing. Sorry if that's all a bit long winded but I hope it helps. Now as far as installing W2k8R2 goes, has anyone managed that? It starts to boot and then just stops, the VM gets destroyed so I'm assuming it crashes. The same problem occurs with Win7 and SBS2008R2 at about the same point. I have installed SBS2008R2 under kvm on a RHEL5.5 box without issue. I've seen mention of a bug where W2k8R2 has a BSOD under KVM. This has apparently been fixed but perhaps it hasn't made it to the version of qemu-kvm in ovirt. Any help would be appreciated. Cheers, Justin. From nicolas.ochem at gmail.com Fri Sep 10 08:04:45 2010 From: nicolas.ochem at gmail.com (Nicolas Ochem) Date: Fri, 10 Sep 2010 10:04:45 +0200 Subject: [Ovirt-devel] Provisioning Windows In-Reply-To: <000c01cb50ac$ce12b2c0$6a381840$@redfish.com.au> References: <4C88F0BA.6040405@redfish.com.au> <000c01cb50ac$ce12b2c0$6a381840$@redfish.com.au> Message-ID: Hello Justin, 1. managing images using cobbler I have not tried to do this. I import the NFS share in ovirt hardware pool. Then, the images are imported as libvirt storage volumes and they are available when I create a VM. Cobbler version has been upgraded between fedora 11 and fedora 13. You are probably the first one trying this under f13. Is there a particular reason why you are using cobbler for this purpose ? 2. booting from cdrom I assume adding the cdrom iso in ovirt would also fix that issue. Besides you will just encounter it once, for installation. Afterwards, you will always boot from HD. 3. too old qemu-kvm You have several choices here : a. download a more recent RPM and install it in the nodes manually each time you start them b. enable the fedora virtualization preview repository in your build environment and build a newer ovirt-node-image.iso c. try to build ovirt under fedora 14 On Fri, Sep 10, 2010 at 7:55 AM, Justin Clacherty wrote: > > How do I go about provisioning a windows VM? I've added the iso to > > cobbler using the following command. > > > > cobbler image add --name=W2k8Prov -- > > file=nfs://192.168.50.190/ovirt/w2k8.iso > > > > The image then appears in the list of Operating Systems to choose when > > creating a VM. I select the image when I create the VM but then when I > go > > to save I get the error: > > > > undefined method `keys' for "~":String > > > > How are people provisioning Windows VMs? > > > > My guess is that people don't. I've spent a bit of time on this today and > have managed to get a VM booting using an installation ISO. It seems > there's some problems with cobbler (or how it's used). I'm still having > problems though so bear with me. > > The problem with installing off ISOs are two-fold. > > 1) Provisioning the VM fails because Cobbler::System.find_one() does not > behave as expected. > 2) The xml sent to libvirtd on the node is incorrect. > > Provisioning Windows Server 2008 R2 is still a problem once this is > resolved. This is seemingly because the version of KVM on the node doesn't > work with W2k8R2. > > Here's the first two problems which I've managed to work around. I hope > this a) helps out anyone else trying to install off an ISO, and b) helps > the > developers fix the issue which as far as I can tell from the mailing list > has been around for a while. > > This is the error I was seeing in rails.log > > Processing VmController#update (for 192.168.42.111 at 2010-09-10 01:57:16) > [POST] > Parameters: {"vm"=>{"nics"=>"#", > "provisioning_and_boot_settings"=>"image at cobbler:W2k8Prov", > "storage_volume_ids"=>["16"], "vm_resource_pool_id"=>"5", > "uuid"=>"59048cfa-d91d-bb65-27b2-edfc5e863d79", > "description"=>"Exchange2010", "memory_allocated_in_mb"=>"4096", > "num_vcpus_allocated"=>"4"}, "id"=>"8", "macs"=>["00:16:3e:76:7b:36", ""], > "networks"=>["1", ""]} > > NoMethodError (undefined method `keys' for "~":String): > (eval):9:in `find_one' > app/services/vm_service.rb:297:in `vm_provision' > app/services/vm_service.rb:169:in `svc_update' > app/services/vm_service.rb:160:in `svc_update' > app/controllers/vm_controller.rb:81:in `update' > > The line in vm_provision is > > System = Cobbler::System.find_one(name) > > Looking at the code around it I'm guessing that the author assumed that > Cobbler::System.find_one() would return null (or is it nil in ruby?) if the > system wasn't found in cobbler. It seems that what actually happens is > that > some exception is thrown (or whatever the ruby equivalent to an exception > is) instead so everything failed. Not knowing ruby at all and knowing that > the system wasn't there I just commented out the check and let it simply > add > the system. That allowed the VM settings to be saved and the VM was > created > in the user interface. I then put the code that I commented out back in to > see if find_one would still be a problem. Wasn't a problem anymore, could > edit the VM and everything which is why I'm assuming that the assumptions > about what find_one does when the system isn't in cobbler are incorrect. > > Now when you boot the VM it tries to boot of the cdrom as you'd expect only > it can't actually find the cdrom. I logged on to the node and did a dump > of > the xml for the vm. The OS was set to boot off cdrom as expected, however, > there's no cdrom entry in there at all. The ISO is described as a "disk". > > To get around this I: > - started the VM > - logged in to the node running the VM > - dumped the xml for the VM to a file > - in the disk entry for the ISO I changed > to > - destroyed the running VM > - created the VM from the edited xml file > > The VM boots, finds the cdrom and does its thing. > > Sorry if that's all a bit long winded but I hope it helps. > > Now as far as installing W2k8R2 goes, has anyone managed that? It starts > to > boot and then just stops, the VM gets destroyed so I'm assuming it crashes. > The same problem occurs with Win7 and SBS2008R2 at about the same point. I > have installed SBS2008R2 under kvm on a RHEL5.5 box without issue. I've > seen mention of a bug where W2k8R2 has a BSOD under KVM. This has > apparently been fixed but perhaps it hasn't made it to the version of > qemu-kvm in ovirt. > > Any help would be appreciated. > > Cheers, > Justin. > > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From justin at redfish.com.au Fri Sep 10 09:08:13 2010 From: justin at redfish.com.au (Justin Clacherty) Date: Fri, 10 Sep 2010 19:08:13 +1000 Subject: [Ovirt-devel] Provisioning Windows In-Reply-To: <000c01cb50ac$ce12b2c0$6a381840$@redfish.com.au> References: <4C88F0BA.6040405@redfish.com.au> <000c01cb50ac$ce12b2c0$6a381840$@redfish.com.au> Message-ID: <4C89F57D.3020607@redfish.com.au> On 10/09/2010 3:55 PM, Justin Clacherty wrote: > Now as far as installing W2k8R2 goes, has anyone managed that? It starts to > boot and then just stops, the VM gets destroyed so I'm assuming it crashes. > The same problem occurs with Win7 and SBS2008R2 at about the same point. I > have installed SBS2008R2 under kvm on a RHEL5.5 box without issue. I've > seen mention of a bug where W2k8R2 has a BSOD under KVM. This has > apparently been fixed but perhaps it hasn't made it to the version of > qemu-kvm in ovirt. Doesn't appear to have been the BSOD bug, that one's fixed in the version of qemu-kvm in ovirt. The node was getting an out of memory error for some reason (should have had 2GB free). Restarted the node and tried again and it all appears to be working. Justin. From justin at redfish.com.au Fri Sep 10 10:36:54 2010 From: justin at redfish.com.au (Justin Clacherty) Date: Fri, 10 Sep 2010 20:36:54 +1000 Subject: [Ovirt-devel] {Disarmed} Re: Provisioning Windows In-Reply-To: References: <4C88F0BA.6040405@redfish.com.au> <000c01cb50ac$ce12b2c0$6a381840$@redfish.com.au> Message-ID: <4C8A0A46.4010801@redfish.com.au> Thanks Nicolas, On 10/09/2010 6:04 PM, Nicolas Ochem wrote: > 1. managing images using cobbler > I have not tried to do this. I import the NFS share in ovirt hardware > pool. Then, the images are imported as libvirt storage volumes and > they are available when I create a VM. > Cobbler version has been upgraded between fedora 11 and fedora 13. You > are probably the first one trying this under f13. > Is there a particular reason why you are using cobbler for this purpose ? I was using cobbler because that's the way I first did it many moons ago when I started using ovirt (2008 I think), and in the absence of documentation to the contrary.... :-) I did try the NFS way but it didn't seem to work for me. I most likely didn't do it correctly. What I did was add the NFS share in the storage pool section. When creating the VM I selected the appropriate iso in the storage section as well as the iscsi volume I wanted to install too. When I started the VM it just said the disk wasn't bootable. What's the correct way to do this? Is there a way to specifiy boot order when you've selected multiple storage pools for the VM? > 2. booting from cdrom > I assume adding the cdrom iso in ovirt would also fix that issue. > Besides you will just encounter it once, for installation. Afterwards, > you will always boot from HD. Yes, switched to boot from HD now. If cobbler is the expected way to install though then this problem really needs to be fixed. Though from (1) I'm assuming cobbler isn't the expected way to install from an ISO. > 3. too old qemu-kvm > You have several choices here : > a. download a more recent RPM and install it in the nodes manually > each time you start them > b. enable the fedora virtualization preview repository in your build > environment and build a newer ovirt-node-image.iso > c. try to build ovirt under fedora 14 That one was a false alarm, I sent a separate email to the list on that one. The node was out of memory (oom kernel panic in /var/log/messages), not sure why as there's only 6GB assigned to VMs and there's 8GB in the machine. Anyway, restarting the node seems to have fixed that issue. Cheers, Justin. From nicolas.ochem at gmail.com Fri Sep 10 10:54:18 2010 From: nicolas.ochem at gmail.com (Nicolas Ochem) Date: Fri, 10 Sep 2010 12:54:18 +0200 Subject: [Ovirt-devel] {Disarmed} Re: Provisioning Windows In-Reply-To: <4C8A0A46.4010801@redfish.com.au> References: <4C88F0BA.6040405@redfish.com.au> <000c01cb50ac$ce12b2c0$6a381840$@redfish.com.au> <4C8A0A46.4010801@redfish.com.au> Message-ID: On Fri, Sep 10, 2010 at 12:36 PM, Justin Clacherty wrote: > Thanks Nicolas, > > On 10/09/2010 6:04 PM, Nicolas Ochem wrote: > >> 1. managing images using cobbler >> I have not tried to do this. I import the NFS share in ovirt hardware >> pool. Then, the images are imported as libvirt storage volumes and they are >> available when I create a VM. >> Cobbler version has been upgraded between fedora 11 and fedora 13. You are >> probably the first one trying this under f13. >> Is there a particular reason why you are using cobbler for this purpose ? >> > > I was using cobbler because that's the way I first did it many moons ago > when I started using ovirt (2008 I think), and in the absence of > documentation to the contrary.... :-) > > I did try the NFS way but it didn't seem to work for me. I most likely > didn't do it correctly. What I did was add the NFS share in the storage > pool section. When creating the VM I selected the appropriate iso in the > storage section as well as the iscsi volume I wanted to install too. When I > started the VM it just said the disk wasn't bootable. What's the correct > way to do this? Is there a way to specifiy boot order when you've selected > multiple storage pools for the VM? > > No, because libvirt has limited support for that. You can select whether to boot from fd, hd, cdrom, or network, but you cannot specify a device in particular. See http://libvirt.org/formatdomain.html#elementsOSBIOS What could be done is to add "cdrom" to ovirt boot options. Then it would pass it to libvirt. But I'm afraid you have to submit the patch yourself :( I assume the general idea is to prepare your VM using your desktop virt management GUI and then move the prepared VMs to ovirt. That's how I do it. > 2. booting from cdrom >> I assume adding the cdrom iso in ovirt would also fix that issue. Besides >> you will just encounter it once, for installation. Afterwards, you will >> always boot from HD. >> > > Yes, switched to boot from HD now. If cobbler is the expected way to > install though then this problem really needs to be fixed. Though from (1) > I'm assuming cobbler isn't the expected way to install from an ISO. > > This "~" issue sure sounds like a bug, but again, probably you're the best candidate to submit a fix. > 3. too old qemu-kvm >> You have several choices here : >> a. download a more recent RPM and install it in the nodes manually each >> time you start them >> b. enable the fedora virtualization preview repository in your build >> environment and build a newer ovirt-node-image.iso >> c. try to build ovirt under fedora 14 >> > > That one was a false alarm, I sent a separate email to the list on that > one. The node was out of memory (oom kernel panic in /var/log/messages), > not sure why as there's only 6GB assigned to VMs and there's 8GB in the > machine. Anyway, restarting the node seems to have fixed that issue. > > Cheers, > Justin. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From justin at redfish.com.au Fri Sep 10 13:53:48 2010 From: justin at redfish.com.au (Justin Clacherty) Date: Fri, 10 Sep 2010 23:53:48 +1000 Subject: [Ovirt-devel] Provisioning Windows In-Reply-To: References: <4C88F0BA.6040405@redfish.com.au> <000c01cb50ac$ce12b2c0$6a381840$@redfish.com.au> <4C8A0A46.4010801@redfish.com.au> Message-ID: <4C8A386C.4090303@redfish.com.au> On 10/09/2010 8:54 PM, Nicolas Ochem wrote: > I assume the general idea is to prepare your VM using your desktop > virt management GUI and then move the prepared VMs to ovirt. That's > how I do it. That's probably the best way at the moment. Ideally I think you need to be able to provision from within the UI though I think. Interested to know what others think. > This "~" issue sure sounds like a bug, but again, probably you're the > best candidate to submit a fix. I'm a C++ man, haven't really looked at ruby before. From what little I understand about ruby I think there just needs to be a rescue in the vm_provision to catch the exception. Though it looks as though the ruby cobbler stuff is not maintained so perhaps they're looking at ditching it from the UI anyway. Any Redhat guys got input on this one? Justin. From aclement at linagora.com Tue Sep 14 09:00:00 2010 From: aclement at linagora.com (Arthur Clement) Date: Tue, 14 Sep 2010 11:00:00 +0200 Subject: [Ovirt-devel] [PATCH] Fix bad declaration in host-register Message-ID: <1284454800-27921-1-git-send-email-aclement@linagora.com> Signed-off-by: Arthur Clement --- src/host-browser/host-register.rb | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/host-browser/host-register.rb b/src/host-browser/host-register.rb index 5ff6a90..7bf957d 100755 --- a/src/host-browser/host-register.rb +++ b/src/host-browser/host-register.rb @@ -393,14 +393,13 @@ class HostRegister < Qmf::ConsoleHandler # if we have a match, then update the database and remove # the received data to avoid creating a dupe later @logger.info "Searching for existing record for: #{detail.macaddr.upcase} in host #{host_qmf.hostname}" - # if detail.interface ~ /eth.*\..*/ || detail.interface ~ /vnet.*/ - if detail.interface =~ /eth\d+\.\d+/ || detail.interface =~ /vnet\d+/ - @logger.info "Don't manage #{detail.interface.inspect}" + if detail.interface_name =~ /eth\d+\.\d+/ || detail.interface_name =~ /vnet\d+/ + @logger.info "Don't manage #{detail.interface_name.inspect}" else if detail.macaddr.upcase == nic.mac - @logger.info "Updating details for: #{detail.interface} [#{nic.mac}]}" + @logger.info "Updating details for: #{detail.interface_name} [#{nic.mac}]}" nic.bandwidth = detail.bandwidth - nic.interface_name = detail.interface + nic.interface_name = detail.interface_name nic.save! found = true nic_info.delete(detail) @@ -430,8 +429,8 @@ class HostRegister < Qmf::ConsoleHandler 'interface_name' => nic.interface, 'usage_type' => 1) - if detail.interface =~ /eth\d+\.\d+/ || detail.interface =~ /vnet\d+/ - @logger.info "Don't Add #{detail.interface.inspect}" + if detail.interface_name =~ /eth\d+\.\d+/ || detail.interface_name =~ /vnet\d+/ + @logger.info "Don't Add #{detail.interface_name.inspect}" else host_db.nics << detail @logger.info "Added NIC #{nic.interface} with MAC #{nic.macaddr} to host #{host_qmf.hostname}" -- 1.7.2.2 From aclement at linagora.com Tue Sep 14 09:07:04 2010 From: aclement at linagora.com (Arthur =?iso-8859-15?q?Cl=E9ment?=) Date: Tue, 14 Sep 2010 11:07:04 +0200 Subject: [Ovirt-devel] [PATCH] Fix bad declaration in host-register In-Reply-To: <1284454800-27921-1-git-send-email-aclement@linagora.com> References: <1284454800-27921-1-git-send-email-aclement@linagora.com> Message-ID: <201009141107.04841.aclement@linagora.com> pushed On mardi 14 septembre 2010 11:00:00 you wrote: > Signed-off-by: Arthur Clement > --- > src/host-browser/host-register.rb | 13 ++++++------- > 1 files changed, 6 insertions(+), 7 deletions(-) > > diff --git a/src/host-browser/host-register.rb > b/src/host-browser/host-register.rb index 5ff6a90..7bf957d 100755 > --- a/src/host-browser/host-register.rb > +++ b/src/host-browser/host-register.rb > @@ -393,14 +393,13 @@ class HostRegister < Qmf::ConsoleHandler > # if we have a match, then update the database and remove > # the received data to avoid creating a dupe later > @logger.info "Searching for existing record for: > #{detail.macaddr.upcase} in host #{host_qmf.hostname}" - # if > detail.interface ~ /eth.*\..*/ || detail.interface ~ /vnet.*/ - if > detail.interface =~ /eth\d+\.\d+/ || detail.interface =~ /vnet\d+/ - > @logger.info "Don't manage #{detail.interface.inspect}" > + if detail.interface_name =~ /eth\d+\.\d+/ || detail.interface_name =~ > /vnet\d+/ + @logger.info "Don't manage > #{detail.interface_name.inspect}" > else > if detail.macaddr.upcase == nic.mac > - @logger.info "Updating details for: > #{detail.interface} [#{nic.mac}]}" + @logger.info > "Updating details for: #{detail.interface_name} [#{nic.mac}]}" > nic.bandwidth = detail.bandwidth > - nic.interface_name = detail.interface > + nic.interface_name = detail.interface_name > nic.save! > found = true > nic_info.delete(detail) > @@ -430,8 +429,8 @@ class HostRegister < Qmf::ConsoleHandler > 'interface_name' => nic.interface, > 'usage_type' => 1) > > - if detail.interface =~ /eth\d+\.\d+/ || detail.interface =~ > /vnet\d+/ - @logger.info "Don't Add > #{detail.interface.inspect}" + if detail.interface_name =~ > /eth\d+\.\d+/ || detail.interface_name =~ /vnet\d+/ + > @logger.info "Don't Add #{detail.interface_name.inspect}" else > host_db.nics << detail > @logger.info "Added NIC #{nic.interface} with MAC > #{nic.macaddr} to host #{host_qmf.hostname}" -- Arthur CLEMENT Linagora Paris From justin at redfish.com.au Wed Sep 15 14:12:35 2010 From: justin at redfish.com.au (Justin Clacherty) Date: Thu, 16 Sep 2010 00:12:35 +1000 Subject: [Ovirt-devel] iSCSI and disk timeouts In-Reply-To: <4C7D7B8A.4000504@redfish.com.au> References: <4C761F2C.6030304@redfish.com.au> <4C7C3A20.7050304@redfish.com.au> <4C7D7B8A.4000504@redfish.com.au> Message-ID: <4C90D453.5030907@redfish.com.au> On 1/09/2010 8:00 AM, Justin Clacherty wrote: > On 1/09/2010 12:37 AM, Nicolas Ochem wrote: >> Hi Justin, >> I can suggest a method to make sure the problem is iscsi related : >> >> -log in to the node >> -copy the image file to RAM (by putting it in /tmp) or to an external >> storage if it's too big >> -restart the VM directly in libvirt (virsh dumpxml, virsh destroy , >> virsh create) after having modified the XML file to point to the >> local version iso iSCSI >> >> If the problem is gone then iscsi is the issue. >> Hope this helps > > Thanks Nicolas, I'll give that a go. I've tried doing this and am still experiencing the problem so it seems iscsi isn't it. It does seem to coincide with disk access though. There are no messages on the guest when it dies, it just hangs. It looks as though the guest is crashing. The following messages appear in dmesg on the node and seem to coincide with the guest hanging. kvm: 19028: cpu0 unimplemented perfctr wrmsr: 0x186 data 0x130079 kvm: 19028: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xffd7695d kvm: 19028: cpu0 unimplemented perfctr wrmsr: 0x186 data 0x530079 kvm: 19028: cpu1 unimplemented perfctr wrmsr: 0x186 data 0x130079 kvm: 19028: cpu1 unimplemented perfctr wrmsr: 0xc1 data 0xffd7695d kvm: 19028: cpu1 unimplemented perfctr wrmsr: 0x186 data 0x530079 Is there a way to tell if it's the node causing the guest to hang? Cheers, Justin. From nicolas.ochem at gmail.com Thu Sep 16 08:33:36 2010 From: nicolas.ochem at gmail.com (Nicolas Ochem) Date: Thu, 16 Sep 2010 10:33:36 +0200 Subject: [Ovirt-devel] iSCSI and disk timeouts In-Reply-To: <4C90D453.5030907@redfish.com.au> References: <4C761F2C.6030304@redfish.com.au> <4C7C3A20.7050304@redfish.com.au> <4C7D7B8A.4000504@redfish.com.au> <4C90D453.5030907@redfish.com.au> Message-ID: https://bugzilla.redhat.com/show_bug.cgi?id=507085 you'll have more chance of solving this in KVM mailing list or IRC channel. Now that iscsi is ruled out, we are sure it is not an ovirt issue. On Wed, Sep 15, 2010 at 4:12 PM, Justin Clacherty wrote: > On 1/09/2010 8:00 AM, Justin Clacherty wrote: > >> On 1/09/2010 12:37 AM, Nicolas Ochem wrote: >> >>> Hi Justin, >>> I can suggest a method to make sure the problem is iscsi related : >>> >>> -log in to the node >>> -copy the image file to RAM (by putting it in /tmp) or to an external >>> storage if it's too big >>> -restart the VM directly in libvirt (virsh dumpxml, virsh destroy , virsh >>> create) after having modified the XML file to point to the local version iso >>> iSCSI >>> >>> If the problem is gone then iscsi is the issue. >>> Hope this helps >>> >> >> Thanks Nicolas, I'll give that a go. >> > > I've tried doing this and am still experiencing the problem so it seems > iscsi isn't it. It does seem to coincide with disk access though. There > are no messages on the guest when it dies, it just hangs. It looks as > though the guest is crashing. > > The following messages appear in dmesg on the node and seem to coincide > with the guest hanging. > > kvm: 19028: cpu0 unimplemented perfctr wrmsr: 0x186 data 0x130079 > kvm: 19028: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xffd7695d > kvm: 19028: cpu0 unimplemented perfctr wrmsr: 0x186 data 0x530079 > kvm: 19028: cpu1 unimplemented perfctr wrmsr: 0x186 data 0x130079 > kvm: 19028: cpu1 unimplemented perfctr wrmsr: 0xc1 data 0xffd7695d > kvm: 19028: cpu1 unimplemented perfctr wrmsr: 0x186 data 0x530079 > > Is there a way to tell if it's the node causing the guest to hang? > > Cheers, > Justin. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From justin at redfish.com.au Thu Sep 16 15:10:50 2010 From: justin at redfish.com.au (Justin Clacherty) Date: Fri, 17 Sep 2010 01:10:50 +1000 Subject: [Ovirt-devel] iSCSI and disk timeouts In-Reply-To: References: <4C761F2C.6030304@redfish.com.au> <4C7C3A20.7050304@redfish.com.au> <4C7D7B8A.4000504@redfish.com.au> <4C90D453.5030907@redfish.com.au> Message-ID: <4C92337A.7020104@redfish.com.au> On 16/09/2010 6:33 PM, Nicolas Ochem wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=507085 Yeah, I'd seen that bug but they seem to suggest it's just noise in dmesg. > you'll have more chance of solving this in KVM mailing list or IRC > channel. Now that iscsi is ruled out, we are sure it is not an ovirt > issue. Thanks, I'll try them out. From sseago at redhat.com Thu Sep 16 15:57:10 2010 From: sseago at redhat.com (Scott Seago) Date: Thu, 16 Sep 2010 11:57:10 -0400 Subject: [Ovirt-devel] Orphaning rubygem-mongrel and related packages Message-ID: <4C923E56.4020908@redhat.com> I haven't used Mongrel for any of my projects in some time now, so I'm no longer an active user and have been unable to find the time to keep up with them. I'm orphaning the following packages, so they're up for grabs for anyone actually using them: rubygem-mongrel rubygem-gem_plugin rubygem-fastthread Looks like the following packages rely on mongrel: ovirt-server-0:0.100-4.fc12.noarch rubygem-merb-core-0:1.0.15-1.fc13.noarch rubygem-mongrel_cluster-0:1.0.5-5.fc13.noarch So anyone with an active interest in the above packages might want to grab these. Thanks, Scott From clement.arthur at gmail.com Sat Sep 18 14:24:05 2010 From: clement.arthur at gmail.com (Arthur Clement) Date: Sat, 18 Sep 2010 16:24:05 +0200 Subject: [Ovirt-devel] New release? In-Reply-To: <20100830153031.GB20747@mcpierce-laptop.rdu.redhat.com> References: <20100830131322.GA10375@mcpierce-laptop.rdu.redhat.com> <201008301703.29926.aclement@linagora.com> <20100830153031.GB20747@mcpierce-laptop.rdu.redhat.com> Message-ID: Hi, I think it might be appropriate to push a new release. There is no more patch in the staging area and we need to ack what we have done last months. The changelog is here : https://fedorahosted.org/ovirt/wiki/News, and I will have time to feed the wiki next week. 2010/8/30 Darryl L. Pierce > On Mon, Aug 30, 2010 at 05:03:29PM +0200, Arthur Cl?ment wrote: > > I don't think ovirt is ready : > > > > - Performance problems with ruby-qmf when there is a significant number > of > > nodes and VMs. We (Linagora) will work on it ASAP. > > > > - Pending patches. > > Okay, that's cool. Let me know when these issues are resolved. > > > - ovirt-node-image is deprecated but what is the new way to build and > install > > a pxe image ? "make ovirt-node-image.iso" is not sufficient to provide a > > pxe/diskless architecture, update cobbler... > > The process should produce an ISO no different from what was previously > created. The only difference is that it's not packaged into an RPM for > delivery. > > > - lack of documentation : I have to update the changelog, create wiki > pages > > for vlan config. > > The ChangeLog bits are definitely something I'd need in order to produce > the RPM. I want to put the changes into the RPM spec so people can see > what's new. > > -- > Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. > Delivering value year after year. > Red Hat ranks #1 in value among software vendors. > http://www.redhat.com/promo/vendor/ > > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From justin at redfish.com.au Sun Sep 19 13:11:27 2010 From: justin at redfish.com.au (Justin Clacherty) Date: Sun, 19 Sep 2010 23:11:27 +1000 Subject: [Ovirt-devel] VM network interface model Message-ID: <4C960BFF.7000108@redfish.com.au> The VMs just boot up with the default network interface model which is 100Mb, is there a way to set it to a 1Gb model? Cheers, Justin. From aclement at linagora.com Mon Sep 20 07:46:43 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Mon, 20 Sep 2010 09:46:43 +0200 Subject: [Ovirt-devel] VM network interface model In-Reply-To: <4C960BFF.7000108@redfish.com.au> References: <4C960BFF.7000108@redfish.com.au> Message-ID: <201009200946.43807.aclement@linagora.com> Hi, Although the driver is 100Mb, the speed is 1Gb. (We tested it). Try to benchmark the link, I'm pretty sure you'll see a 1 Gb link. On dimanche 19 septembre 2010 15:11:27 Justin Clacherty wrote: > The VMs just boot up with the default network interface model which is > 100Mb, is there a way to set it to a 1Gb model? > > Cheers, > Justin. > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel -- Arthur CLEMENT Linagora Paris From apevec at gmail.com Mon Sep 20 11:33:29 2010 From: apevec at gmail.com (Alan Pevec) Date: Mon, 20 Sep 2010 13:33:29 +0200 Subject: [Ovirt-devel] New release? In-Reply-To: References: <20100830131322.GA10375@mcpierce-laptop.rdu.redhat.com> <201008301703.29926.aclement@linagora.com> <20100830153031.GB20747@mcpierce-laptop.rdu.redhat.com> Message-ID: On Sat, Sep 18, 2010 at 4:24 PM, Arthur Clement wrote: > I think it might be appropriate to push a new release. There is no more > patch in the staging area and we need to ack what we have done last months. > The changelog is here :?https://fedorahosted.org/ovirt/wiki/News, and I will > have time to feed the wiki next week. I have no objection to the new release of ovirt-server but for node please hold till next week, I have an internal patch queue I'd like to flush first. Thanks, Alan From justin at redfish.com.au Mon Sep 20 11:53:20 2010 From: justin at redfish.com.au (Justin Clacherty) Date: Mon, 20 Sep 2010 21:53:20 +1000 Subject: [Ovirt-devel] VM network interface model In-Reply-To: <201009200946.43807.aclement@linagora.com> References: <4C960BFF.7000108@redfish.com.au> <201009200946.43807.aclement@linagora.com> Message-ID: <4C974B30.3050409@redfish.com.au> I thought that may have been the case so I tried before posting and was only getting 100Mb. I'll retry in case my test was incorrect. Cheers, Justin. On 20/09/2010 5:46 PM, Arthur Cl?ment wrote: > Although the driver is 100Mb, the speed is 1Gb. (We tested it). Try to > benchmark the link, I'm pretty sure you'll see a 1 Gb link. > > > On dimanche 19 septembre 2010 15:11:27 Justin Clacherty wrote: >> The VMs just boot up with the default network interface model which is >> 100Mb, is there a way to set it to a 1Gb model? >> >> Cheers, >> Justin. From justin at redfish.com.au Mon Sep 20 12:01:41 2010 From: justin at redfish.com.au (Justin Clacherty) Date: Mon, 20 Sep 2010 22:01:41 +1000 Subject: [Ovirt-devel] Jumbo frame support on nodes Message-ID: <4C974D25.5090909@redfish.com.au> On the network theme again. The adapters on the management/storage network all default to an mtu of 1500. Are there plans to be able to indicate when a network supports jumbo frames? Cheers, Justin. From aclement at linagora.com Mon Sep 20 12:30:53 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Mon, 20 Sep 2010 14:30:53 +0200 Subject: [Ovirt-devel] Jumbo frame support on nodes In-Reply-To: <4C974D25.5090909@redfish.com.au> References: <4C974D25.5090909@redfish.com.au> Message-ID: <201009201430.53260.aclement@linagora.com> Hello, Yes there is a plan to add jumbo frames, but I don't know when. If you have time, you can take a look into libvirt doc or contact libvirt developpers to see how jumbo frames work. It's half the work of this patch. On lundi 20 septembre 2010 14:01:41 Justin Clacherty wrote: > On the network theme again. The adapters on the management/storage > network all default to an mtu of 1500. Are there plans to be able to > indicate when a network supports jumbo frames? > > Cheers, > Justin. > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel -- Arthur CLEMENT Linagora Paris From dpierce at redhat.com Mon Sep 20 12:42:33 2010 From: dpierce at redhat.com (Darryl L. Pierce) Date: Mon, 20 Sep 2010 08:42:33 -0400 Subject: [Ovirt-devel] New release? In-Reply-To: References: <20100830131322.GA10375@mcpierce-laptop.rdu.redhat.com> <201008301703.29926.aclement@linagora.com> <20100830153031.GB20747@mcpierce-laptop.rdu.redhat.com> Message-ID: <20100920124233.GD3754@mcpierce-laptop.rdu.redhat.com> On Sat, Sep 18, 2010 at 04:24:05PM +0200, Arthur Clement wrote: > I think it might be appropriate to push a new release. There is no more > patch in the staging area and we need to ack what we have done last months. > > The changelog is here : https://fedorahosted.org/ovirt/wiki/News, and I will > have time to feed the wiki next week. Are there any dependencies in this ovirt-server build on updates to ovirt-node? -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From justin at redfish.com.au Mon Sep 20 12:43:11 2010 From: justin at redfish.com.au (Justin Clacherty) Date: Mon, 20 Sep 2010 22:43:11 +1000 Subject: [Ovirt-devel] Jumbo frame support on nodes In-Reply-To: <201009201430.53260.aclement@linagora.com> References: <4C974D25.5090909@redfish.com.au> <201009201430.53260.aclement@linagora.com> Message-ID: <4C9756DF.6020709@redfish.com.au> On 20/09/2010 10:30 PM, Arthur Cl?ment wrote: > If you have time, you can take a look into libvirt doc or contact libvirt > developpers to see how jumbo frames work. It's half the work of this patch. Is it a libvirt issue? I'm talking about jumbo frame support on the node which would be mounting iscsi volumes to export to the VMs running on it. Wouldn't that be part of the node configuration when it boots? I'm not familiar with the node boot sequence so maybe that is delivered via libvirt. Of course once that's done the next step would be to make jumbo frames available to VMs running on the node which would definitely be a libvirt issue. Cheers, Justin. From berrange at redhat.com Mon Sep 20 12:52:55 2010 From: berrange at redhat.com (Daniel P. Berrange) Date: Mon, 20 Sep 2010 13:52:55 +0100 Subject: [Ovirt-devel] Jumbo frame support on nodes In-Reply-To: <4C9756DF.6020709@redfish.com.au> References: <4C974D25.5090909@redfish.com.au> <201009201430.53260.aclement@linagora.com> <4C9756DF.6020709@redfish.com.au> Message-ID: <20100920125255.GG18143@redhat.com> On Mon, Sep 20, 2010 at 10:43:11PM +1000, Justin Clacherty wrote: > On 20/09/2010 10:30 PM, Arthur Cl?ment wrote: > >If you have time, you can take a look into libvirt doc or contact libvirt > >developpers to see how jumbo frames work. It's half the work of this patch. > > Is it a libvirt issue? I'm talking about jumbo frame support on the > node which would be mounting iscsi volumes to export to the VMs running > on it. Wouldn't that be part of the node configuration when it boots? > I'm not familiar with the node boot sequence so maybe that is delivered > via libvirt. Of course once that's done the next step would be to make > jumbo frames available to VMs running on the node which would definitely > be a libvirt issue. When setting up jumbo frames using bridging you need to several things - Set MTU on the physical NIC - Set MTU on the bridge - Set MTU on the TAP devices you must do the first two before the bridge is brought online. when libvirt creates a TAP device for a guest, it will automatically copy the MTU of the bridge to the TAP device. So if ovirt is configuring the physical NIC and bridge with a suitably large MTU, the libvirt bit will 'just work'. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| From justin at redfish.com.au Mon Sep 20 15:53:33 2010 From: justin at redfish.com.au (Justin Clacherty) Date: Tue, 21 Sep 2010 01:53:33 +1000 Subject: [Ovirt-devel] Jumbo frame support on nodes In-Reply-To: <20100920125255.GG18143@redhat.com> References: <4C974D25.5090909@redfish.com.au> <201009201430.53260.aclement@linagora.com> <4C9756DF.6020709@redfish.com.au> <20100920125255.GG18143@redhat.com> Message-ID: <4C97837D.1020607@redfish.com.au> On 20/09/2010 10:52 PM, Daniel P. Berrange wrote: > > When setting up jumbo frames using bridging you need to several things > > - Set MTU on the physical NIC > - Set MTU on the bridge > - Set MTU on the TAP devices > > you must do the first two before the bridge is brought online. when libvirt > creates a TAP device for a guest, it will automatically copy the MTU of > the bridge to the TAP device. So if ovirt is configuring the physical NIC > and bridge with a suitably large MTU, the libvirt bit will 'just work'. Ok. So what's needed for this is the ability to set the MTU size in the user interface and for that to be sent on to the host when it's network is configured at boot. Would this be best done when editing the network on a particular host, when adding networks in the network section of the user interface, or in both places? Once that's done, the MTU size needs to be sent to the node at boot time with the other network settings and the node needs to create it's devices with the specified MTU. Justin. From berrange at redhat.com Mon Sep 20 16:06:49 2010 From: berrange at redhat.com (Daniel P. Berrange) Date: Mon, 20 Sep 2010 17:06:49 +0100 Subject: [Ovirt-devel] Jumbo frame support on nodes In-Reply-To: <4C97837D.1020607@redfish.com.au> References: <4C974D25.5090909@redfish.com.au> <201009201430.53260.aclement@linagora.com> <4C9756DF.6020709@redfish.com.au> <20100920125255.GG18143@redhat.com> <4C97837D.1020607@redfish.com.au> Message-ID: <20100920160649.GI18143@redhat.com> On Tue, Sep 21, 2010 at 01:53:33AM +1000, Justin Clacherty wrote: > On 20/09/2010 10:52 PM, Daniel P. Berrange wrote: > > > >When setting up jumbo frames using bridging you need to several things > > > > - Set MTU on the physical NIC > > - Set MTU on the bridge > > - Set MTU on the TAP devices > > > >you must do the first two before the bridge is brought online. when libvirt > >creates a TAP device for a guest, it will automatically copy the MTU of > >the bridge to the TAP device. So if ovirt is configuring the physical NIC > >and bridge with a suitably large MTU, the libvirt bit will 'just work'. > > Ok. So what's needed for this is the ability to set the MTU size in the > user interface and for that to be sent on to the host when it's network > is configured at boot. Would this be best done when editing the network > on a particular host, when adding networks in the network section of the > user interface, or in both places? I think either probably works. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :| From scourtois at linagora.com Tue Sep 21 15:20:26 2010 From: scourtois at linagora.com (Simon COURTOIS) Date: Tue, 21 Sep 2010 17:20:26 +0200 Subject: [Ovirt-devel] [PATCH] Fixing a loading issue with the Start On form Message-ID: <1285082426-36361-1-git-send-email-scourtois@linagora.com> Signed-off-by: Simon COURTOIS --- src/app/views/vm/start.rhtml | 76 +++++++++++++++++++++-------------------- 1 files changed, 39 insertions(+), 37 deletions(-) diff --git a/src/app/views/vm/start.rhtml b/src/app/views/vm/start.rhtml index bed1d2d..f80cf70 100644 --- a/src/app/views/vm/start.rhtml +++ b/src/app/views/vm/start.rhtml @@ -4,6 +4,45 @@ <%- content_for :description do -%> Please choose a Host to start the Virtual Machine. Leave the selection blank to allow oVirt to choose the most appropriate starting host. <%- end -%> + + +
@@ -38,40 +77,3 @@
<%= popup_footer("$('#start_vm_form').submit()", "Start Virtual Machine") %> - -- 1.7.2.3 From aclement at linagora.com Tue Sep 21 16:04:52 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Tue, 21 Sep 2010 18:04:52 +0200 Subject: [Ovirt-devel] [PATCH] Fixing a loading issue with the Start On form In-Reply-To: <1285082426-36361-1-git-send-email-scourtois@linagora.com> References: <1285082426-36361-1-git-send-email-scourtois@linagora.com> Message-ID: <201009211804.52206.aclement@linagora.com> ACK On mardi 21 septembre 2010 17:20:26 Simon COURTOIS wrote: > Signed-off-by: Simon COURTOIS > --- > src/app/views/vm/start.rhtml | 76 > +++++++++++++++++++++-------------------- 1 files changed, 39 > insertions(+), 37 deletions(-) > > diff --git a/src/app/views/vm/start.rhtml b/src/app/views/vm/start.rhtml > index bed1d2d..f80cf70 100644 > --- a/src/app/views/vm/start.rhtml > +++ b/src/app/views/vm/start.rhtml > @@ -4,6 +4,45 @@ > <%- content_for :description do -%> > Please choose a Host to start the Virtual Machine. Leave the selection > blank to allow oVirt to choose the most appropriate starting host. <%- end > -%> > + > + > + >
> >
@@ -38,40 +77,3 @@ >
> <%= popup_footer("$('#start_vm_form').submit()", "Start Virtual > Machine") %> > - -- Arthur CLEMENT Linagora Paris From aclement at linagora.com Tue Sep 21 16:24:02 2010 From: aclement at linagora.com (Arthur Clement) Date: Tue, 21 Sep 2010 18:24:02 +0200 Subject: [Ovirt-devel] [PATCH] Check cpus capacity, not real cores. Message-ID: <1285086242-27774-1-git-send-email-aclement@linagora.com> Hi, is there a good reason why taskomatic check the number of real cores in the find_capable_host ? It prevents to use the full capacity of multithreading Signed-off-by: Arthur Clement --- src/task-omatic/taskomatic.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index 6f699d2..59a0fdd 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -169,7 +169,7 @@ class TaskOmatic #puts "and not #{curr.is_disabled.nil?} and #{curr.is_disabled == 0}" #puts "and #{vm ? vm : 'nil'} or #{vm ? vm.active : 'nil'}) or #{vm ? vm.node : 'nil'} != #{node.object_id}" - if node and node.cores >= db_vm.num_vcpus_allocated \ + if node and node.cpus >= db_vm.num_vcpus_allocated \ and node.memory >= db_vm.memory_allocated \ and not curr.is_disabled.nil? and curr.is_disabled == 0 \ and ((!vm or vm.active == 'false') or vm.node != node.object_id) -- 1.7.2.3 From nicolas.ochem at gmail.com Tue Sep 21 19:52:47 2010 From: nicolas.ochem at gmail.com (Nicolas Ochem) Date: Tue, 21 Sep 2010 19:52:47 +0000 Subject: [Ovirt-devel] [PATCH] Introduce ability to select any kind of nic model, not just default or virtio. Message-ID: <1285098767-1193-1-git-send-email-nicolas.ochem@gmail.com> There was no release since virtio support was introduced, so a proper migration is not necessary. Signed-off-by: Nicolas Ochem --- src/app/controllers/vm_controller.rb | 6 ++- src/app/models/nic.rb | 2 + src/app/views/vm/_form.rhtml | 25 +++++++++------- src/db/migrate/046_add_model_to_nic.rb | 29 ++++++++++++++++++ src/public/stylesheets/components.css | 51 +++++++++++++++++++++++-------- src/task-omatic/task_vm.rb | 5 +-- src/task-omatic/taskomatic.rb | 2 +- 7 files changed, 89 insertions(+), 31 deletions(-) create mode 100644 src/db/migrate/046_add_model_to_nic.rb diff --git a/src/app/controllers/vm_controller.rb b/src/app/controllers/vm_controller.rb index adc8988..54abd15 100644 --- a/src/app/controllers/vm_controller.rb +++ b/src/app/controllers/vm_controller.rb @@ -199,7 +199,7 @@ class VmController < ApplicationController nnic = Nic.new(:mac => nic.mac, :vm_id => @vm.id, :network => nic.network, - :virtio => nic.virtio) + :model => nic.model) if(nic.network.boot_type.proto == 'static') nnic.ip_addresses << IpAddress.new(:address => nic.ip_address) @@ -221,6 +221,8 @@ class VmController < ApplicationController @nics.push nnic } + @nic_models = Nic::NIC_MODELS + end # merges vm / network parameters as submitted on the vm form @@ -241,7 +243,7 @@ class VmController < ApplicationController nic = { :mac => params[:macs][i], :network_id => network_id, :bandwidth => 0, - :virtio => params[:virtio][i.to_s] } + :model => params[:models][i] } if(Network.find(network_id).boot_type.proto == 'static') # FIXME make this able to be v4 or v6 address diff --git a/src/app/models/nic.rb b/src/app/models/nic.rb index 51425bc..18218a3 100644 --- a/src/app/models/nic.rb +++ b/src/app/models/nic.rb @@ -53,6 +53,8 @@ class Nic < ActiveRecord::Base validates_numericality_of :bandwidth, :greater_than_or_equal_to => 0 + NIC_MODELS = ["ne2k_pci","i82551","i82557b","i82559er","rtl8139","e1000","pcnet","virtio"] + # Returns whether the nic has networking defined. def networking? (network != nil) diff --git a/src/app/views/vm/_form.rhtml b/src/app/views/vm/_form.rhtml index 1ab6dda..465733d 100644 --- a/src/app/views/vm/_form.rhtml +++ b/src/app/views/vm/_form.rhtml @@ -67,6 +67,7 @@
Network:
MAC Address:
+
Model:
<%# this column is only populated if a static ip network is selected: %> @@ -92,14 +93,16 @@
-
-   +
+
-
- <%= hidden_field_tag "virtio[#{i}]", "0" %> - <%= check_box_tag "virtio[#{i}]", "1", @nics[i].virtio, :id => "vm_network_config_virtio_#{i}" %> - <%= label_tag "vm_network_config_virtio_#{i}", "Use virtio" %> +
+  
<% if i != 0 %> @@ -196,7 +199,7 @@ ${htmlList(pools, id)} jnic.name = "<%= rnic.network.name %>"; jnic.mac = "<%= rnic.mac %>"; jnic.ip = "<%= rnic.ip_address %>"; - jnic.virtio = <%= rnic.virtio ? 'true' : 'false' %>; + jnic.model = "<%= rnic.model %>" jnic.static_ip = <%= rnic.network.boot_type.proto == 'static' %>; jnic.selected = false; jnic.row = null; @@ -270,15 +273,15 @@ ${htmlList(pools, id)} $('#vm_network_config_mac_'+row).attr('value', nic.mac); // show / hide ip address textbox - ip_div = $('#vm_network_config_mac_'+row).parent().next(); + ip_div = $('#vm_network_config_model_'+row).parent().next(); if(nic.static_ip){ ip_div.html(''); }else{ ip_div.html(' '); } - // set virtio if checked - $('#vm_network_config_virtio_'+row).attr('checked', nic.virtio ? 'checked' : ''); + // set model + $('#vm_network_config_model_'+row).attr('value', nic.model); // show new row only if last row's select box was // previously empty, and if all are not shown @@ -302,7 +305,7 @@ ${htmlList(pools, id)} // clear row mac and ip addresses $('#vm_network_config_mac_'+row).attr('value', ''); $('#vm_network_config_mac_'+row).parent().next().html(' '); - $('#vm_network_config_virtio_'+row).attr('checked', ''); + //$('#vm_network_config_virtio_'+row).attr('checked', ''); // hide row if not the first if(row != 0){ diff --git a/src/db/migrate/046_add_model_to_nic.rb b/src/db/migrate/046_add_model_to_nic.rb new file mode 100644 index 0000000..1ec42a9 --- /dev/null +++ b/src/db/migrate/046_add_model_to_nic.rb @@ -0,0 +1,29 @@ +# Copyright (C) 2010 Alcatel-Lucent +# Written by Nicolas Ochem +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301, USA. A copy of the GNU General Public License is +# also available at http://www.gnu.org/copyleft/gpl.html. +class AddModelToNic < ActiveRecord::Migration + def self.up + add_column :nics, :model, :string + remove_column :nics, :virtio + end + + def self.down + remove_column :nics, :model + add_column :nics, :virtio, :boolean, :default => false + end +end + diff --git a/src/public/stylesheets/components.css b/src/public/stylesheets/components.css index 3cdbf49..fe4043e 100644 --- a/src/public/stylesheets/components.css +++ b/src/public/stylesheets/components.css @@ -349,41 +349,66 @@ min-width: 500px; } -#vm_network_config_header_network, -#vm_network_config_header_mac, #vm_network_config_header_ip{ float: left; - width: 150px; + width: 102px; } -.vm_network_config_net, -.vm_network_config_mac{ +#vm_network_config_header_network{ + float: left; + width:92px; +} + +#vm_network_config_header_mac{ + float: left; + width: 132px; +} + +#vm_network_config_header_model{ + float: left; + width: 76px; +} + +.vm_network_config_net{ float: left; - width: 150px; + width: 92px; } +.vm_network_config_mac{ + float: left; + width: 132px; +} .vm_network_config_ip{ float: left; - max-width: 150px; + width: 100px; } -.vm_network_config_virtio { +.vm_network_config_model { float: left; - width: 80px; + width: 76px; +} + +.vm_network_config_ip input{ + width: 100px; } -.vm_network_config_net select, -.vm_network_config_mac input, -.vm_network_config_ip input { - width: 130px; +.vm_network_config_net select{ + width: 90px; } +.vm_network_config_model select { + width: 74px; +} +.vm_network_config_mac input{ + width:125px; +} .vm_network_config_remove { float: left; color: #0033CC; padding-top: 5px; padding-left: 5px; } + .vm_network_config_remove:hover { cursor: pointer; } diff --git a/src/task-omatic/task_vm.rb b/src/task-omatic/task_vm.rb index 9efda1c..a3391c0 100644 --- a/src/task-omatic/task_vm.rb +++ b/src/task-omatic/task_vm.rb @@ -99,10 +99,7 @@ def create_vm_xml(name, uuid, memAllocated, memUsed, vcpus, bootDevice, interface.add_attribute("type", "bridge") interface.add_element("mac", {"address" => nic[:mac]}) interface.add_element("source", {"bridge" => nic[:interface]}) - - if nic[:virtio] - interface.add_element("model", {"type" => "virtio"}) - end + interface.add_element("model", {"type" => nic[:model]}) doc.root.elements["devices"] << interface } diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index 83849ad..9c2a162 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -430,7 +430,7 @@ class TaskOmatic else net_device = "breth0" # FIXME remove this default at some point end - net_interfaces.push({ :mac => nic.mac, :interface => net_device, :virtio => nic.virtio }) + net_interfaces.push({ :mac => nic.mac, :interface => net_device, :model => nic.model }) } # network_always indicates that the boot device is "network" and will not change # upon reboot. -- 1.7.2.1 From nicolas.ochem at gmail.com Tue Sep 21 19:55:16 2010 From: nicolas.ochem at gmail.com (Nicolas Ochem) Date: Tue, 21 Sep 2010 21:55:16 +0200 Subject: [Ovirt-devel] VM network interface model In-Reply-To: <4C960BFF.7000108@redfish.com.au> References: <4C960BFF.7000108@redfish.com.au> Message-ID: my patch from today (sept 21) should allow just that, in the Vm dialog. On Sun, Sep 19, 2010 at 3:11 PM, Justin Clacherty wrote: > The VMs just boot up with the default network interface model which is > 100Mb, is there a way to set it to a 1Gb model? > > Cheers, > Justin. > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aclement at linagora.com Thu Sep 23 09:38:36 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Thu, 23 Sep 2010 11:38:36 +0200 Subject: [Ovirt-devel] [PATCH 1/2] Monkey-patch mongrel to fix rails 2.3.5 incompatibility In-Reply-To: <1280504647-1415-1-git-send-email-nicolas.ochem@alcatel-lucent.com> References: <1280504647-1415-1-git-send-email-nicolas.ochem@alcatel-lucent.com> Message-ID: <201009231138.36252.aclement@linagora.com> ACK On vendredi 30 juillet 2010 17:44:07 nicolas.ochem at gmail.com wrote: > From: Nicolas Ochem > > > Signed-off-by: Nicolas Ochem > --- > src/config/initializers/mongrel_patch.rb | 11 +++++++++++ > 1 files changed, 11 insertions(+), 0 deletions(-) > create mode 100644 src/config/initializers/mongrel_patch.rb > > diff --git a/src/config/initializers/mongrel_patch.rb > b/src/config/initializers/mongrel_patch.rb new file mode 100644 > index 0000000..ae2bcf4 > --- /dev/null > +++ b/src/config/initializers/mongrel_patch.rb > @@ -0,0 +1,11 @@ > +# monkey patch to make mongrel compatible with rails 2.3.5 > +# fixes faulty redirection issue. > +# TODO : ditch mongrel and switch to passenger instead. > +class Mongrel::CGIWrapper > + def header_with_rails_fix(options = 'text/html') > + @head['cookie'] = options.delete('cookie').flatten.map { |v| > v.sub(/^\n/,'') } if options.class != String and options['cookie'] + > header_without_rails_fix(options) > + end > + alias_method_chain(:header, :rails_fix) > +end if (Rails.version == '2.3.5' or Rails.version == '2.3.8') and > Gem.available?('mongrel', Gem::Requirement.new('~>1.1.5')) and > self.class.const_defined?(:Mongrel) + -- Arthur CLEMENT Linagora Paris From aclement at linagora.com Thu Sep 23 09:39:00 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Thu, 23 Sep 2010 11:39:00 +0200 Subject: [Ovirt-devel] [PATCH 2/2] Added "runtime_mode=ovirt" as boot parameter for ovirt node from cobbler otherwise it does not communicate with ovirt-server. In-Reply-To: <1280504884-1477-1-git-send-email-nicolas.ochem@alcatel-lucent.com> References: <1280504884-1477-1-git-send-email-nicolas.ochem@alcatel-lucent.com> Message-ID: <201009231139.00947.aclement@linagora.com> ACK On vendredi 30 juillet 2010 17:48:04 nicolas.ochem at gmail.com wrote: > From: Nicolas Ochem > > > Signed-off-by: Nicolas Ochem > --- > installer/modules/ovirt/files/cobbler-import | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/installer/modules/ovirt/files/cobbler-import > b/installer/modules/ovirt/files/cobbler-import index e6a6764..6de3110 > 100755 > --- a/installer/modules/ovirt/files/cobbler-import > +++ b/installer/modules/ovirt/files/cobbler-import > @@ -46,7 +46,7 @@ node_dir=/usr/share/ovirt-node-image > > cobbler distro add --name="oVirt-Node-$node_arch" --arch=$node_arch \ > --initrd=$node_dir/tftpboot/initrd0.img > --kernel=$node_dir/tftpboot/vmlinuz0 \ - --kopts="rootflags=loop > root=live:/ovirt-node-image.iso rootfstype=iso9660 ro console=tty0 > console=ttyS0,115200n8" + --kopts="rootflags=loop > root=live:/ovirt-node-image.iso runtime_mode=ovirt rootfstype=iso9660 ro > console=tty0 console=ttyS0,115200n8" > > cobbler profile add --name=oVirt-Node-$node_arch > --distro=oVirt-Node-$node_arch cobbler system add --netboot-enabled=1 > --profile=oVirt-Node-$node_arch \ -- Arthur CLEMENT Linagora Paris From aclement at linagora.com Fri Sep 24 13:23:24 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Fri, 24 Sep 2010 15:23:24 +0200 Subject: [Ovirt-devel] [PATCH] Fixing a loading issue with the Start On form In-Reply-To: <201009211804.52206.aclement@linagora.com> References: <1285082426-36361-1-git-send-email-scourtois@linagora.com> <201009211804.52206.aclement@linagora.com> Message-ID: <201009241523.25324.aclement@linagora.com> Pushed On mardi 21 septembre 2010 18:04:52 Arthur Cl?ment wrote: > ACK > > On mardi 21 septembre 2010 17:20:26 Simon COURTOIS wrote: > > Signed-off-by: Simon COURTOIS > > --- > > > > src/app/views/vm/start.rhtml | 76 > > > > +++++++++++++++++++++-------------------- 1 files changed, 39 > > insertions(+), 37 deletions(-) > > > > diff --git a/src/app/views/vm/start.rhtml b/src/app/views/vm/start.rhtml > > index bed1d2d..f80cf70 100644 > > --- a/src/app/views/vm/start.rhtml > > +++ b/src/app/views/vm/start.rhtml > > @@ -4,6 +4,45 @@ > > > > <%- content_for :description do -%> > > > > Please choose a Host to start the Virtual Machine. Leave the selection > > > > blank to allow oVirt to choose the most appropriate starting host. <%- > > end -%> > > + > > + > > + > > > >
> > > >
@@ -38,40 +77,3 @@ > > > >
> > <%= popup_footer("$('#start_vm_form').submit()", "Start Virtual > > > > Machine") %> > > - -- Arthur CLEMENT Linagora Paris From aclement at linagora.com Fri Sep 24 13:58:22 2010 From: aclement at linagora.com (Arthur =?iso-8859-15?q?Cl=E9ment?=) Date: Fri, 24 Sep 2010 15:58:22 +0200 Subject: [Ovirt-devel] [PATCH] Check cpus capacity, not real cores. In-Reply-To: <1285086242-27774-1-git-send-email-aclement@linagora.com> References: <1285086242-27774-1-git-send-email-aclement@linagora.com> Message-ID: <201009241558.23076.aclement@linagora.com> ACK on irc and pushed comments above the code updated On mardi 21 septembre 2010 18:24:02 Arthur Clement wrote: > Hi, is there a good reason why taskomatic check the number of real cores in > the find_capable_host ? It prevents to use the full capacity of > multithreading > > > Signed-off-by: Arthur Clement > --- > src/task-omatic/taskomatic.rb | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb > index 6f699d2..59a0fdd 100755 > --- a/src/task-omatic/taskomatic.rb > +++ b/src/task-omatic/taskomatic.rb > @@ -169,7 +169,7 @@ class TaskOmatic > #puts "and not #{curr.is_disabled.nil?} and #{curr.is_disabled == > 0}" #puts "and #{vm ? vm : 'nil'} or #{vm ? vm.active : 'nil'}) or #{vm ? > vm.node : 'nil'} != #{node.object_id}" > > - if node and node.cores >= db_vm.num_vcpus_allocated \ > + if node and node.cpus >= db_vm.num_vcpus_allocated \ > and node.memory >= db_vm.memory_allocated \ > and not curr.is_disabled.nil? and curr.is_disabled == 0 \ > and ((!vm or vm.active == 'false') or vm.node != node.object_id) -- Arthur CLEMENT Linagora Paris From aclement at linagora.com Fri Sep 24 22:19:03 2010 From: aclement at linagora.com (Arthur Clement) Date: Sat, 25 Sep 2010 00:19:03 +0200 Subject: [Ovirt-devel] [PATCH] Fix requires qpidd and qpidc are now qpid-cpp-server and qpid-cpp-client Message-ID: <1285366743-23935-1-git-send-email-aclement@linagora.com> Signed-off-by: Arthur Clement --- ovirt-server.spec.in | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ovirt-server.spec.in b/ovirt-server.spec.in index c54cd6a..6808878 100644 --- a/ovirt-server.spec.in +++ b/ovirt-server.spec.in @@ -40,8 +40,8 @@ Requires: ruby-libvirt >= 0.0.2 Requires: rrdtool-ruby Requires: iscsi-initiator-utils Requires: cyrus-sasl-gssapi -Requires: qpidd -Requires: qpidc +Requires: qpid-cpp-server +Requires: qpid-cpp-client Requires: qmf >= 0.5.829175-2 Requires: ruby-qmf Requires(post): /sbin/chkconfig -- 1.7.2.3 From clement.arthur at gmail.com Fri Sep 24 22:53:40 2010 From: clement.arthur at gmail.com (Arthur Clement) Date: Sat, 25 Sep 2010 00:53:40 +0200 Subject: [Ovirt-devel] [PATCH] Fix requires qpidd and qpidc are now qpid-cpp-server and qpid-cpp-client In-Reply-To: <1285366743-23935-1-git-send-email-aclement@linagora.com> References: <1285366743-23935-1-git-send-email-aclement@linagora.com> Message-ID: Pushed. cf http://www.spinics.net/lists/fedora-devel/msg143281.html On Sat, Sep 25, 2010 at 12:19 AM, Arthur Clement wrote: > > Signed-off-by: Arthur Clement > --- > ovirt-server.spec.in | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/ovirt-server.spec.in b/ovirt-server.spec.in > index c54cd6a..6808878 100644 > --- a/ovirt-server.spec.in > +++ b/ovirt-server.spec.in > @@ -40,8 +40,8 @@ Requires: ruby-libvirt >= 0.0.2 > Requires: rrdtool-ruby > Requires: iscsi-initiator-utils > Requires: cyrus-sasl-gssapi > -Requires: qpidd > -Requires: qpidc > +Requires: qpid-cpp-server > +Requires: qpid-cpp-client > Requires: qmf >= 0.5.829175-2 > Requires: ruby-qmf > Requires(post): /sbin/chkconfig > -- > 1.7.2.3 > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: From justin at redfish.com.au Tue Sep 28 09:04:01 2010 From: justin at redfish.com.au (Justin Clacherty) Date: Tue, 28 Sep 2010 09:04:01 +0000 Subject: [Ovirt-devel] Out of memory causes VM shutdown Message-ID: I created a new VM today and it ran for a while before mysteriously disappearing. I logged in to the node it was running on to take a look at the logs and it looks as though the VM was shut down because the node ran out of memory. This particular node has 8GB in it and was running 4 VMs (including the crashed one). The memory assigned to each VM was 4G, 1.5G, 512M, 256M. It was the 256M VM that was started last and that's the one that was shutdown. What are the memory requirements of the host OS? Another thing I've noticed on the node is that as the memory usage increases a lot of processor time is spent running ksmd. Presumably it's spending time reclaiming memory from buffers and cache. Aren't buffers generally used for disk buffering? Does the host OS need to do this given the guest OS will also be buffering the disks? Cheers, Justin. -------------- next part -------------- An HTML attachment was scrubbed... URL: From liste at alixen.fr Tue Sep 28 09:39:01 2010 From: liste at alixen.fr (Benoit Guguin) Date: Tue, 28 Sep 2010 11:39:01 +0200 Subject: [Ovirt-devel] Out of memory causes VM shutdown In-Reply-To: References: Message-ID: <4CA1B7B5.1000305@alixen.fr> Hi, Le 28/09/2010 11:04, Justin Clacherty a ?crit : > I created a new VM today and it ran for a while before mysteriously > disappearing. I logged in to the node it was running on to take a look > at the logs and it looks as though the VM was shut down because the node > ran out of memory. This particular node has 8GB in it and was running 4 > VMs (including the crashed one). The memory assigned to each VM was 4G, > 1.5G, 512M, 256M. It was the 256M VM that was started last and that?s > the one that was shutdown. What are the memory requirements of the host OS? > Wath's your qemu-kvm version ? Indeed there was a memory leak on 12.3 corrected in 12.4. Well you can use a network superviser (zabbix, nagios,...) to see that ;). > Another thing I?ve noticed on the node is that as the memory usage > increases a lot of processor time is spent running ksmd. Presumably it?s > spending time reclaiming memory from buffers and cache. Aren?t buffers > generally used for disk buffering? Does the host OS need to do this > given the guest OS will also be buffering the disks? > More Memory more thing to analyse, more cpu. You can control some parameters through : /sys/kernel/mm/ksm Regards, > Cheers, > > Justin. > > > > _______________________________________________ > Ovirt-devel mailing list > Ovirt-devel at redhat.com > https://www.redhat.com/mailman/listinfo/ovirt-devel From nicolas.ochem at alcatel-lucent.com Wed Sep 29 14:39:37 2010 From: nicolas.ochem at alcatel-lucent.com (Nicolas Ochem) Date: Wed, 29 Sep 2010 16:39:37 +0200 Subject: [Ovirt-devel] [PATCH 1/2] Monkey-patch mongrel to fix rails 2.3.5 incompatibility In-Reply-To: <201009231138.36252.aclement@linagora.com> References: <1280504647-1415-1-git-send-email-nicolas.ochem@alcatel-lucent.com> <201009231138.36252.aclement@linagora.com> Message-ID: <4CA34FA9.1030706@alcatel-lucent.com> Pushed. On 09/23/2010 11:38 AM, Arthur Cl?ment wrote: > ACK > > > On vendredi 30 juillet 2010 17:44:07 nicolas.ochem at gmail.com wrote: > >> From: Nicolas Ochem >> >> >> Signed-off-by: Nicolas Ochem >> --- >> src/config/initializers/mongrel_patch.rb | 11 +++++++++++ >> 1 files changed, 11 insertions(+), 0 deletions(-) >> create mode 100644 src/config/initializers/mongrel_patch.rb >> >> diff --git a/src/config/initializers/mongrel_patch.rb >> b/src/config/initializers/mongrel_patch.rb new file mode 100644 >> index 0000000..ae2bcf4 >> --- /dev/null >> +++ b/src/config/initializers/mongrel_patch.rb >> @@ -0,0 +1,11 @@ >> +# monkey patch to make mongrel compatible with rails 2.3.5 >> +# fixes faulty redirection issue. >> +# TODO : ditch mongrel and switch to passenger instead. >> +class Mongrel::CGIWrapper >> + def header_with_rails_fix(options = 'text/html') >> + @head['cookie'] = options.delete('cookie').flatten.map { |v| >> v.sub(/^\n/,'') } if options.class != String and options['cookie'] + >> header_without_rails_fix(options) >> + end >> + alias_method_chain(:header, :rails_fix) >> +end if (Rails.version == '2.3.5' or Rails.version == '2.3.8') and >> Gem.available?('mongrel', Gem::Requirement.new('~>1.1.5')) and >> self.class.const_defined?(:Mongrel) + >> From nicolas.ochem at alcatel-lucent.com Wed Sep 29 14:39:59 2010 From: nicolas.ochem at alcatel-lucent.com (Nicolas Ochem) Date: Wed, 29 Sep 2010 16:39:59 +0200 Subject: [Ovirt-devel] [PATCH 2/2] Added "runtime_mode=ovirt" as boot parameter for ovirt node from cobbler otherwise it does not communicate with ovirt-server. In-Reply-To: <201009231139.00947.aclement@linagora.com> References: <1280504884-1477-1-git-send-email-nicolas.ochem@alcatel-lucent.com> <201009231139.00947.aclement@linagora.com> Message-ID: <4CA34FBF.3090502@alcatel-lucent.com> Pushed. On 09/23/2010 11:39 AM, Arthur Cl?ment wrote: > ACK > > On vendredi 30 juillet 2010 17:48:04 nicolas.ochem at gmail.com wrote: > >> From: Nicolas Ochem >> >> >> Signed-off-by: Nicolas Ochem >> --- >> installer/modules/ovirt/files/cobbler-import | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/installer/modules/ovirt/files/cobbler-import >> b/installer/modules/ovirt/files/cobbler-import index e6a6764..6de3110 >> 100755 >> --- a/installer/modules/ovirt/files/cobbler-import >> +++ b/installer/modules/ovirt/files/cobbler-import >> @@ -46,7 +46,7 @@ node_dir=/usr/share/ovirt-node-image >> >> cobbler distro add --name="oVirt-Node-$node_arch" --arch=$node_arch \ >> --initrd=$node_dir/tftpboot/initrd0.img >> --kernel=$node_dir/tftpboot/vmlinuz0 \ - --kopts="rootflags=loop >> root=live:/ovirt-node-image.iso rootfstype=iso9660 ro console=tty0 >> console=ttyS0,115200n8" + --kopts="rootflags=loop >> root=live:/ovirt-node-image.iso runtime_mode=ovirt rootfstype=iso9660 ro >> console=tty0 console=ttyS0,115200n8" >> >> cobbler profile add --name=oVirt-Node-$node_arch >> --distro=oVirt-Node-$node_arch cobbler system add --netboot-enabled=1 >> --profile=oVirt-Node-$node_arch \ >> From aclement at linagora.com Thu Sep 30 07:33:25 2010 From: aclement at linagora.com (Arthur =?iso-8859-1?q?Cl=E9ment?=) Date: Thu, 30 Sep 2010 09:33:25 +0200 Subject: [Ovirt-devel] libvirt-qpid and live migration Message-ID: <201009300933.26326.aclement@linagora.com> I have troubles with live migration since I upgraded libvirt on my nodes 1) I have to change 'Libvirt::Domain::MIGRATE_LIVE' to '1' in taskomatic error : Error: uninitialized constant Libvirt::Domain::MIGRATE_LIVE and why '1' : http://libvirt.org/html/libvirt-libvirt.html 2) the migration fails with this error : Task action processing failed: RuntimeError: Timed out waiting for response So I looked into taskomatic code and I saw this comment : # Sadly migrate with qpid is broken because it requires a connection between # both nodes and currently that can't happen securely. For now we do it # the old fashioned way.. I could'nt get Ian Main on Irc, so I asked here if someone knows about this issue. I tried to test qpid migration with python (method : migrate(destinationUri, flags, newDomainName, uri, bandwidth)) but I might be to stupid to know what's the difference between destinationUri and uri. I tested objectid, hostname... I only got errors. My idea is to test live migration with qpid and replace the old method if it works. -- Arthur CLEMENT Linagora Paris