Commit b920f0f3 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

wip: make sure storage refreshed

parent 3068d6db
...@@ -2816,6 +2816,7 @@ sub _start_domain_after_create($domain, $request, $uid,$previous_request) { ...@@ -2816,6 +2816,7 @@ sub _start_domain_after_create($domain, $request, $uid,$previous_request) {
uid => $uid uid => $uid
,id_domain => $domain->id ,id_domain => $domain->id
,remote_ip => $remote_ip ,remote_ip => $remote_ip
,at => time + 3
,@after_req ,@after_req
); );
...@@ -2840,6 +2841,8 @@ sub _add_extra_iso($domain, $request, $previous_request) { ...@@ -2840,6 +2841,8 @@ sub _add_extra_iso($domain, $request, $previous_request) {
my $extra_iso = $iso->{extra_iso}; my $extra_iso = $iso->{extra_iso};
return if !$extra_iso; return if !$extra_iso;
$previous_request = $request if !$previous_request;
my ($url, $file_re) = $extra_iso =~ m{(.*/)(.*)}; my ($url, $file_re) = $extra_iso =~ m{(.*/)(.*)};
my $volume = $domain->_vm->search_volume_path_re(qr($file_re)); my $volume = $domain->_vm->search_volume_path_re(qr($file_re));
...@@ -2853,9 +2856,14 @@ sub _add_extra_iso($domain, $request, $previous_request) { ...@@ -2853,9 +2856,14 @@ sub _add_extra_iso($domain, $request, $previous_request) {
$volume = $domain->_vm->dir_img()."/$device"; $volume = $domain->_vm->dir_img()."/$device";
$download = 1 if $device; $download = 1 if $device;
} }
my $req = Ravada::Request->refresh_storage(id_vm => $domain->_vm->id); my @after_request;
@after_request = ( after_request => $previous_request->id )
if $previous_request;
my $req = Ravada::Request->refresh_storage(id_vm => $domain->_vm->id
,@after_request);
$req->after_request($previous_request->id) if $previous_request; @after_request = ( after_request => $req->id ) if $req;
my $req_add = Ravada::Request->add_hardware( my $req_add = Ravada::Request->add_hardware(
name => 'disk' name => 'disk'
...@@ -2865,7 +2873,8 @@ sub _add_extra_iso($domain, $request, $previous_request) { ...@@ -2865,7 +2873,8 @@ sub _add_extra_iso($domain, $request, $previous_request) {
file => $volume file => $volume
,device => 'cdrom' ,device => 'cdrom'
} }
,after_request => $req->id ,@after_request
,at => time+5
); );
$domain->_vm->_download_file_external($extra_iso, $volume) $domain->_vm->_download_file_external($extra_iso, $volume)
......
...@@ -83,7 +83,7 @@ our %VALID_ARG = ( ...@@ -83,7 +83,7 @@ our %VALID_ARG = (
,set_driver => {uid => 1, id_domain => 1, id_option => 1} ,set_driver => {uid => 1, id_domain => 1, id_option => 1}
,hybernate=> {uid => 1, id_domain => 1} ,hybernate=> {uid => 1, id_domain => 1}
,download => {uid => 2, id_iso => 1, id_vm => 2, vm => 2, verbose => 2, delay => 2, test => 2} ,download => {uid => 2, id_iso => 1, id_vm => 2, vm => 2, verbose => 2, delay => 2, test => 2}
,refresh_storage => { id_vm => 2 } ,refresh_storage => { id_vm => 2, uid => 2 }
,list_storage_pools => { id_vm => 1 , uid => 1 } ,list_storage_pools => { id_vm => 1 , uid => 1 }
,check_storage => { uid => 1 } ,check_storage => { uid => 1 }
,set_base_vm=> {uid => 1, id_vm=> 1, id_domain => 1, value => 2 } ,set_base_vm=> {uid => 1, id_vm=> 1, id_domain => 1, value => 2 }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment