Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
my ($vtype, $name, $vmid, undef, undef, $isBase) =
$plugin->parse_volname($volname);
my ($vtype, $name, $vmid, undef, undef, $isBase) =
$plugin->parse_volname($volname);
if ($isBase) {
my $vollist = $plugin->list_images($storeid, $scfg);
foreach my $info (@$vollist) {
if ($isBase) {
my $vollist = $plugin->list_images($storeid, $scfg);
foreach my $info (@$vollist) {
my $cleanup_worker = $plugin->free_image($storeid, $scfg, $volname, $isBase);
});
my $cleanup_worker = $plugin->free_image($storeid, $scfg, $volname, $isBase);
});
my $pool = $values[0];
my $image = $values[1];
my $owner;
my $pool = $values[0];
my $image = $values[1];
my $owner;
- if ($image =~ m/^(vm-(\d+)-\S+)$/) {
- $owner = $2;
+
+ if ($image =~ m/^((vm|base)-(\d+)-\S+)$/) {
+ $owner = $3;
}
my $props = nexenta_get_zvol_props($scfg, $zvol);
}
my $props = nexenta_get_zvol_props($scfg, $zvol);
+ my $parent = $props->{origin};
+ if($parent && $parent =~ m/^$scfg->{pool}\/(\S+)$/){
+ $parent = $1;
+ }
$list->{$pool}->{$image} = {
name => $image,
size => $props->{size_bytes},
$list->{$pool}->{$image} = {
name => $image,
size => $props->{size_bytes},
- parent => $props->{origin},
format => 'raw',
vmid => $owner
};
format => 'raw',
vmid => $owner
};