Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
snf-ganeti
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
snf-ganeti
Commits
9abe9caf
Commit
9abe9caf
authored
15 years ago
by
Iustin Pop
Browse files
Options
Downloads
Patches
Plain Diff
Fix hspace with plain type instances
This also fixes other required node numbers.
parent
927aa3ee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hspace.hs
+10
-4
10 additions, 4 deletions
hspace.hs
with
10 additions
and
4 deletions
hspace.hs
+
10
−
4
View file @
9abe9caf
...
...
@@ -194,12 +194,17 @@ main = do
offline_indices
=
map
Node
.
idx
$
filter
(
\
n
->
elem
(
Node
.
name
n
)
offline_names
)
all_nodes
req_nodes
=
optINodes
opts
when
(
length
offline_wrong
>
0
)
$
do
printf
"Error: Wrong node name(s) set as offline: %s
\n
"
(
commaJoin
offline_wrong
)
exitWith
$
ExitFailure
1
when
(
req_nodes
/=
1
&&
req_nodes
/=
2
)
$
do
printf
"Error: Invalid required nodes (%d)
\n
"
req_nodes
exitWith
$
ExitFailure
1
let
nl
=
Container
.
map
(
\
n
->
if
elem
(
Node
.
idx
n
)
offline_indices
then
Node
.
setOffline
n
True
else
n
)
fixed_nl
...
...
@@ -233,8 +238,7 @@ main = do
newinst
=
Instance
.
create
"new"
(
optIMem
opts
)
(
optIDsk
opts
)
"ADMIN_down"
(
-
1
)
(
-
1
)
let
(
fin_nl
,
ixes
)
=
iterateDepth
nl
il
newinst
(
optINodes
opts
)
[]
let
(
fin_nl
,
ixes
)
=
iterateDepth
nl
il
newinst
req_nodes
[]
allocs
=
length
ixes
fin_instances
=
num_instances
+
allocs
fin_ixes
=
reverse
ixes
...
...
@@ -245,14 +249,16 @@ main = do
printf
"Final instances: %d
\n
"
(
num_instances
+
allocs
)
printf
"Final free RAM: %d
\n
"
final_mem
printf
"Final free disk: %d
\n
"
final_disk
printf
"Usage: %.
2
f
\n
"
(((
fromIntegral
num_instances
)
::
Double
)
/
printf
"Usage: %.
5
f
\n
"
(((
fromIntegral
num_instances
)
::
Double
)
/
(
fromIntegral
fin_instances
))
printf
"Allocations: %d
\n
"
allocs
when
(
verbose
>
1
)
$
do
putStr
.
unlines
.
map
(
\
i
->
printf
"Inst: %*s %-*s %-*s"
ix_namelen
(
Instance
.
name
i
)
nmlen
(
Container
.
nameOf
fin_nl
$
Instance
.
pnode
i
)
nmlen
(
Container
.
nameOf
fin_nl
$
Instance
.
snode
i
))
nmlen
(
let
sdx
=
Instance
.
snode
i
in
if
sdx
==
Node
.
noSecondary
then
""
else
Container
.
nameOf
fin_nl
sdx
))
$
fin_ixes
when
(
optShowNodes
opts
)
$
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment