]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/API2/Disks/ZFS.pm
api: disks: create: set correct partition type
[pve-storage.git] / PVE / API2 / Disks / ZFS.pm
index 6486404b917bbac5cd79bdba8b019c0ca4e8346c..7f96bb7cc338140a3bd625a9c3e72428ae241e1c 100644 (file)
@@ -375,6 +375,17 @@ __PACKAGE__->register_method ({
                    PVE::Diskmanage::assert_disk_unused($dev);
 
                    my $is_partition = PVE::Diskmanage::is_partition($dev);
+
+                   if ($is_partition) {
+                       eval {
+                           PVE::Diskmanage::change_parttype(
+                               $dev,
+                               '6a898cc3-1dd2-11b2-99a6-080020736631',
+                           );
+                       };
+                       warn $@ if $@;
+                   }
+
                    my $sysfsdev = $is_partition ? PVE::Diskmanage::get_blockdev($dev) : $dev;
 
                    $sysfsdev =~ s!^/dev/!/sys/block/!;