[Ovirt-devel] [PATCH] added ability to reprovision vm via edit vm form

Perry N. Myers pmyers at redhat.com
Tue Sep 2 16:30:49 UTC 2008


Scott Seago wrote:
> Mohammed Morsi wrote:
>> ---
>>  wui/src/app/controllers/vm_controller.rb |   29 
>> +++++++++++++++++------------
>>  wui/src/app/views/vm/_form.rhtml         |    2 +-
>>  2 files changed, 18 insertions(+), 13 deletions(-)
>>
>> diff --git a/wui/src/app/controllers/vm_controller.rb 
>> b/wui/src/app/controllers/vm_controller.rb
>> index e55ec28..6d32427 100644
>> --- a/wui/src/app/controllers/vm_controller.rb
>> +++ b/wui/src/app/controllers/vm_controller.rb
>> @@ -267,6 +271,7 @@ class VmController < ApplicationController
>>      @perm_obj = @vm.vm_resource_pool
>>      @redir_obj = @vm
>>      @current_pool_id=@perm_obj.id
>> +    _setup_provisioning
>>    end
>>    def pre_vm_action
>>      pre_edit
>> diff --git a/wui/src/app/views/vm/_form.rhtml 
>> b/wui/src/app/views/vm/_form.rhtml
>> index 60ed003..0dfe940 100644
>> --- a/wui/src/app/views/vm/_form.rhtml
>> +++ b/wui/src/app/views/vm/_form.rhtml
>> @@ -8,7 +8,7 @@
>>  <%= hidden_field_tag 'hardware_pool_id', @hardware_pool.id if 
>> @hardware_pool %>
>>  
>>      <%= text_field_with_label "Name:", "vm", "description", 
>> {:style=>"width:250px;"}  %>
>> -    <%= select_with_label "Operating System:", 'vm', 
>> 'provisioning_and_boot_settings', @provisioning_options, 
>> :style=>"width:250px;"  if create %>
>> +    <%= select_with_label "Operating System:", 'vm', 
>> 'provisioning_and_boot_settings', @provisioning_options, 
>> :style=>"width:250px;" %>
>>      <div class="clear_row" style="height:15px;"></div>
>>  
>>      <div class="form_heading">Resources</div>
>>   
> 
> The UI needs to make it clear that changing the provisioning bits on a 
> running VM will potentially wipe the contents of the current VM and 
> reprovision from scratch. In addition, if the VM is currently running, 
> should we provide the user an easy way to force an immediate reboot (so 
> the provisioning can take effect). Currently we have a 'start VM now' 
> button for creating VMs -- maybe for edit, we should provide the option 
> to start/restart VM now.

This is not always the case... This new UI for changing the provisioning 
could also be used to 'boot a rescue ISO' or something like that.  In 
which case it's not going to blow away your existing disk.  A rescue ISO 
in cobbler looks the same as an F9 install ISO...

> Also, we need to be careful in how we handle the boot device and cobbler 
> profile fields. Currently cobbler profile is only set on create -- so 
> the above won't actually register a new cobbler system (and what of the 
> old cobbler system -- do we need to un-register it? There's also the 
> automatic update of the boot device on successful boot -- I don't think 
> the above will cause any problems with that though.

Maybe we should treat editing the provisioning information as a create 
call.  i.e. if you change the VM in this way it removes the exising vm and 
creates a new one.  Would that work?

If unregistration of a system is necessary we should make that happen in 
the create call in taskomatic for ALL creates.  i.e. whenever create is 
called it should first try to delete the system record in cobbler (and 
fail silently if that record does not exist) and then create a new one.

That will handle the reprovisioning case.

Perry




More information about the ovirt-devel mailing list