fix bug #12: check storage availability early (migrate)

This commit is contained in:
Dietmar Maurer 2012-03-30 09:13:31 +02:00
parent 8b192abf57
commit 47152e2ee3
4 changed files with 29 additions and 1 deletions

View File

@ -2,7 +2,7 @@ RELEASE=2.0
VERSION=2.0
PACKAGE=qemu-server
PKGREL=33
PKGREL=34
DESTDIR=
PREFIX=/usr

View File

@ -1633,6 +1633,9 @@ __PACKAGE__->register_method({
if !$param->{online};
}
my $storecfg = PVE::Storage::config();
PVE::QemuServer::check_storage_availability($storecfg, $conf, "test");
if (&$vm_is_ha_managed($vmid) && $rpcenv->{type} ne 'ha') {
my $hacmd = sub {

View File

@ -1682,6 +1682,25 @@ sub check_local_resources {
return $loc_res;
}
# check is used storages are available on all nodes (use by migrate)
sub check_storage_availability {
my ($storecfg, $conf, $node) = @_;
foreach_drive($conf, sub {
my ($ds, $drive) = @_;
my $volid = $drive->{file};
return if !$volid;
my ($sid, $volname) = PVE::Storage::parse_volume_id($volid, 1);
return if !$sid;
# check if storage is available on both nodes
my $scfg = PVE::Storage::storage_check_node($storecfg, $sid);
PVE::Storage::storage_check_node($storecfg, $sid, $node);
});
}
sub check_lock {
my ($conf) = @_;

View File

@ -1,3 +1,9 @@
qemu-server (2.0-34) unstable; urgency=low
* fix bug #12: check storage availability early (migrate)
-- Proxmox Support Team <support@proxmox.com> Fri, 30 Mar 2012 09:12:46 +0200
qemu-server (2.0-33) unstable; urgency=low
* fix bug #121: activate volumes correctly