Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
182da879
Commit
182da879
authored
Nov 20, 2013
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow to call ceph init multiple times
parent
f8609964
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
33 deletions
+37
-33
Ceph.pm
PVE/API2/Ceph.pm
+37
-33
No files found.
PVE/API2/Ceph.pm
View file @
182da879
...
...
@@ -508,7 +508,7 @@ __PACKAGE__->register_method ({
name
=>
'
init
',
path
=>
'
init
',
method
=>
'
POST
',
description
=>
"
Create initial ceph
configuration
.
",
description
=>
"
Create initial ceph
default configuration and setup symlinks
.
",
proxyto
=>
'
node
',
protected
=>
1
,
parameters
=>
{
...
...
@@ -526,7 +526,7 @@ __PACKAGE__->register_method ({
pg_bits
=>
{
description
=>
"
Placement group bits, used to specify the default number of placement groups (Note: 'osd pool default pg num' does not work for deafult pools)
",
type
=>
'
integer
',
default
=>
9
,
default
=>
6
,
optional
=>
1
,
minimum
=>
6
,
maximum
=>
14
,
...
...
@@ -539,38 +539,45 @@ __PACKAGE__->register_method ({
&
$check_ceph_installed
();
-
f
$pve_ceph_cfgpath
&&
die
"
configuration file '
$pve_ceph_cfgpath
' already exists.
\n
"
;
# simply load old config if it already exists
my
$cfg
=
&
$parse_ceph_config
(
$pve_ceph_cfgpath
)
;
my
$pg_bits
=
$param
->
{
pg_bits
}
||
9
;
my
$size
=
$param
->
{
size
}
||
2
;
my
$keyring
=
'
/etc/pve/priv/$cluster.$name.keyring
';
my
$fsid
;
my
$uuid
;
UUID::
generate
(
$uuid
);
UUID::
unparse
(
$uuid
,
$fsid
);
my
$global
=
{
'
fsid
'
=>
$fsid
,
'
auth supported
'
=>
'
cephx
',
'
auth cluster required
'
=>
'
cephx
',
'
auth service required
'
=>
'
cephx
',
'
auth client required
'
=>
'
cephx
',
'
keyring
'
=>
'
/etc/pve/priv/$cluster.$name.keyring
',
'
filestore xattr use omap
'
=>
'
true
',
'
osd journal size
'
=>
'
1024
',
'
osd pool default size
'
=>
$size
,
'
osd pool default min size
'
=>
1
,
'
osd pg bits
'
=>
$pg_bits
,
'
osd pgp bits
'
=>
$pg_bits
,
};
if
(
!
$cfg
->
{
global
})
{
my
$fsid
;
my
$uuid
;
# this does not work for default pools
#'osd pool default pg num' => $pg_num,
#'osd pool default pgp num' => $pg_num,
UUID::
generate
(
$uuid
);
UUID::
unparse
(
$uuid
,
$fsid
);
$cfg
->
{
global
}
=
{
'
fsid
'
=>
$fsid
,
'
auth supported
'
=>
'
cephx
',
'
auth cluster required
'
=>
'
cephx
',
'
auth service required
'
=>
'
cephx
',
'
auth client required
'
=>
'
cephx
',
'
filestore xattr use omap
'
=>
'
true
',
'
osd journal size
'
=>
'
1024
',
'
osd pool default min size
'
=>
1
,
};
# this does not work for default pools
#'osd pool default pg num' => $pg_num,
#'osd pool default pgp num' => $pg_num,
}
$cfg
->
{
global
}
->
{
keyring
}
=
$keyring
;
&
$write_ceph_config
({
global
=>
$global
});
$cfg
->
{
global
}
->
{'
osd pool default size
'}
=
$param
->
{
size
}
if
$param
->
{
size
};
if
(
$param
->
{
pg_bits
})
{
$cfg
->
{
global
}
->
{'
osd pg bits
'}
=
$param
->
{
pg_bits
};
$cfg
->
{
global
}
->
{'
osd pgp bits
'}
=
$param
->
{
pg_bits
};
}
&
$write_ceph_config
(
$cfg
);
&
$setup_pve_symlinks
();
...
...
@@ -1077,9 +1084,6 @@ __PACKAGE__->register_method ({
&
$check_ceph_inited
();
die
"
not fully configured - missing '
$pve_ckeyring_path
'
\n
"
if
!
-
f
$pve_ckeyring_path
;
&
$setup_pve_symlinks
();
print
"
create OSD on
$param
->{dev}
\n
";
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment