} elsif ($scfg->{type} eq 'drbd') {
$volid = PVE::Storage::vdisk_alloc($storage_conf, $storage, $vmid, 'raw', undef, $size);
-
+
+ } elsif ($scfg->{type} eq 'rbd') {
+
+ die "krbd option must be enabled on storage type '$scfg->{type}'\n" if !$scfg->{krbd};
+ $volid = PVE::Storage::vdisk_alloc($storage_conf, $storage, $vmid, 'raw', undef, $size);
+
} else {
die "unable to create containers on storage type '$scfg->{type}'\n";
}
} elsif ($scfg->{type} eq 'zfspool') {
my $rootfs = PVE::Storage::path($storage_cfg, $volid);
$raw .= "lxc.rootfs = $rootfs\n";
- } elsif ($scfg->{type} eq 'drbd') {
+ } elsif ($scfg->{type} eq 'drbd' || $scfg->{type} eq 'rbd') {
my $rootdev = PVE::Storage::path($storage_cfg, $volid);
$raw .= "lxc.rootfs = $rootdev\n";
} else {
create_rootfs_subvol($storage_cfg, $storage, $volid, $vmid, $conf, $archive, $password, $restore);
} elsif ($format eq 'raw') {
my $scfg = PVE::Storage::storage_config($storage_cfg, $storage);
+ PVE::Storage::activate_storage($storage_cfg, $storage);
+ PVE::Storage::activate_volumes($storage_cfg, [$volid]);
if ($scfg->{path}) {
create_rootfs_dir_loop($storage_cfg, $storage, $volid, $vmid, $conf, $archive, $password, $restore);
- } elsif ($scfg->{type} eq 'drbd') {
+ } elsif ($scfg->{type} eq 'drbd' || $scfg->{type} eq 'rbd') {
create_rootfs_dev($storage_cfg, $storage, $volid, $vmid, $conf, $archive, $password, $restore);
} else {
die "unable to create containers on storage type '$scfg->{type}'\n";
}
+ PVE::Storage::deactivate_volumes($storage_cfg, [$volid]);
} else {
die "unsupported image format '$format'\n";
}