nexenta : clone_image
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
committed by
Dietmar Maurer
parent
1c0097dd51
commit
324679682e
@ -272,7 +272,25 @@ sub create_base {
|
|||||||
sub clone_image {
|
sub clone_image {
|
||||||
my ($class, $scfg, $storeid, $volname, $vmid) = @_;
|
my ($class, $scfg, $storeid, $volname, $vmid) = @_;
|
||||||
|
|
||||||
die "not implemented";
|
my $snap = '__base__';
|
||||||
|
|
||||||
|
my ($vtype, $basename, $basevmid, undef, undef, $isBase) =
|
||||||
|
$class->parse_volname($volname);
|
||||||
|
|
||||||
|
die "clone_image only works on base images\n" if !$isBase;
|
||||||
|
|
||||||
|
my $name = &$find_free_diskname($storeid, $scfg, $vmid);
|
||||||
|
|
||||||
|
warn "clone $volname: $basename to $name\n";
|
||||||
|
|
||||||
|
my $newvol = "$basename/$name";
|
||||||
|
|
||||||
|
nexenta_request($scfg, 'clone', 'zvol', "$scfg->{pool}/$basename\@$snap", "$scfg->{pool}/$name");
|
||||||
|
|
||||||
|
nexenta_create_lu($scfg, $name);
|
||||||
|
nexenta_add_lun_mapping_entry($scfg, $name);
|
||||||
|
|
||||||
|
return $newvol;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub alloc_image {
|
sub alloc_image {
|
||||||
|
|||||||
Reference in New Issue
Block a user