]> git.proxmox.com Git - pve-manager.git/commitdiff
pveceph: allow to specify fs-type
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 31 Dec 2013 07:12:20 +0000 (08:12 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 31 Dec 2013 07:12:20 +0000 (08:12 +0100)
PVE/API2/Ceph.pm

index 58ad1ab3afb9b2b023f4bfea265352514eb3e4b7..f262be578123c03d7b7eef14975f398b886311e6 100644 (file)
@@ -1123,7 +1123,14 @@ __PACKAGE__->register_method ({
            dev => {
                description => "Block device name.",
                type => 'string',
-           }
+           },
+           fstype => {
+               description => "File system type.",
+               type => 'string',
+               enum => ['xfs', 'ext4', 'btrfs'],
+               default => 'xfs',
+               optional => 1,
+           },
        },
     },
     returns => { type => 'string' },
@@ -1163,9 +1170,11 @@ __PACKAGE__->register_method ({
        my $worker = sub {
            my $upid = shift;
 
-           print "create OSD on $param->{dev}\n";
+           my $fstype = $param->{fstype} || 'xfs';
+
+           print "create OSD on $param->{dev} ($fstype)\n";
 
-           run_command(['ceph-disk', 'prepare', '--zap-disk', '--fs-type', 'xfs',
+           run_command(['ceph-disk', 'prepare', '--zap-disk', '--fs-type', $fstype,
                         '--cluster', $ccname, '--cluster-uuid', $fsid,
                         '--', $param->{dev}]);
        };