Skip to content

Commit ec2a91d

Browse files
authored
MEP-12: Rack Spreading (#125)
1 parent 7280a4b commit ec2a91d

File tree

10 files changed

+654
-11
lines changed

10 files changed

+654
-11
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea
22
docs/build
3+
*.pdf

.vscode/settings.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"markdown.marp.themes": [
3+
"marp/themes/metal-stack.css"
4+
],
5+
"markdown.marp.enableHtml": true
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Rack Spreading
2+
3+
Currently, when creating a machine through the metal-api, the machine is placed randomly inside a partition. This algorithm does not consider spreading machines across different racks and different chassis. This may lead to the situation that a group of machines (that for example form a cluster) can end up being placed in the same rack and the same chassis.
4+
5+
Spreading a group of machines across racks can enhance availability for scenarios like a rack loosing power or a chassis meltdown.
6+
7+
So, instead of just randomly deciding the placement of a machine candidate, we want to propose a placement strategy that attempts to spread machine candidates across the racks inside a partition.
8+
9+
## Placement Strategy
10+
11+
Machines in the project are spread across all available racks evenly (best effort), the user can optionally pass placement tags which will be considered for spreading the machines as well (this will for example allow spreading by a cluster id tag inside the same project).
12+
13+
## API
14+
15+
```golang
16+
// service/v1/machine.go
17+
18+
type MachineAllocation struct {
19+
// existing fields are omitted for readability
20+
PlacementTags []string `json:"tags" description:"by default machines are spread across the racks inside a partition for every project. if placement tags are provided, the machine candidate has an additional anti-affinity to other machines having the same tags"`
21+
}
22+
```

docs/src/development/proposals/MEP12/partitioning-1.svg

+1
Loading

docs/src/development/proposals/MEP12/partitioning-2.svg

+1
Loading

docs/src/development/proposals/MEP12/partitioning-3.svg

+1
Loading

docs/src/development/proposals/MEP12/partitioning.drawio.svg

+486
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
marp: true
3+
theme: metal-stack
4+
paginate: true
5+
footer: Gerrit Schwerthelm – x-cellent technologies GmbH — metal-stack Training
6+
backgroundImage: url("https://metal-stack.io/images/shape/banner.png")
7+
---
8+
<!-- _class: cover lead -->
9+
10+
![h:200px](https://metal-stack.io/images/metal-stack-full-white-border.svg)
11+
12+
---
13+
<!-- _class: cover lead -->
14+
15+
# Multi-Partition-Layout
16+
17+
---
18+
<!--
19+
_class: lead
20+
_backgroundColor: #1f1f1f
21+
_backgroundImage:
22+
_footer: ""
23+
-->
24+
![bg contain](partitioning-1.svg)
25+
26+
---
27+
<!--
28+
_class: lead
29+
_backgroundColor: #1f1f1f
30+
_backgroundImage:
31+
_footer: ""
32+
-->
33+
![bg contain](partitioning-2.svg)
34+
35+
---
36+
<style>section { font-size: 30px; }</style>
37+
38+
# Multi-Partition-Layout Properties
39+
40+
41+
- Fully independent locations with own storage and own node networks
42+
- Clusters can only be created independent in every location
43+
- Failover mechanism for deployed applications requires duplicated deployments, which can serve indepedently
44+
- Failover through BGP
45+
- If cluster nodes are spread across partitions (not implemented yet), nodes will not be able to reach each other
46+
- Would require an overlay network for inter-node-communication
47+
48+
---
49+
<!-- _class: cover lead -->
50+
51+
# Single-Partition-Layout
52+
53+
---
54+
<!--
55+
_class: lead
56+
_backgroundColor: #1f1f1f
57+
_backgroundImage:
58+
_footer: ""
59+
-->
60+
![bg contain](partitioning-3.svg)
61+
62+
---
63+
<style>section { font-size: 30px; }</style>
64+
65+
# Single-Partition-Layout Properties
66+
67+
- Multiple groups of racks at multiple locations but connected to same CLOS topology
68+
- All racks can connect to the same storage network
69+
- Nodes in private networks can communicate
70+
- When creating a cluster, nodes will be randomly spread across the racks
71+
- Possible improvement of this situation, see `MEP-12: Rack Spreading`
72+
73+
---
74+
75+
# MEP-12: Rack Spreading
76+
77+
- Instead of selecting a machine from a machine pool randomly
78+
- Get all existing machines in the same project and count to which rack they belong
79+
- Place machine on the rack with the least amount of machines already allocated
80+
- Best effort only

docs/src/development/proposals/index.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ Possible states are:
1717

1818
Once a proposal was accepted, an issue should be raised and the implementation should be done in a separate PR.
1919

20-
| Name | Description | State |
21-
| :----------------------- | :--------------------------------------------- | :-------------: |
22-
| [MEP-1](MEP1/README.md) | Distributed Control Plane Deployment | `In Discussion` |
23-
| [MEP-2](MEP2/README.md) | Two Factor Authentication | `Aborted` |
24-
| [MEP-3](MEP3/README.md) | Machine Re-Installation to preserve local data | `Completed` |
25-
| [MEP-4](MEP4/README.md) | Multi-tenancy for the metal-api | `Accepted` |
26-
| [MEP-5](MEP5/README.md) | Shared Networks | `Completed` |
27-
| [MEP-6](MEP6/README.md) | DMZ Networks | `Completed` |
28-
| [MEP-8](MEP8/README.md) | Configurable Filesystemlayout | `Completed` |
29-
| [MEP-9](MEP9/README.md) | No Open Ports To the Data Center | `In Progress` |
30-
| [MEP-11](MEP9/README.md) | Auditing of metal-stack resources | `In Progress` |
20+
| Name | Description | State |
21+
| :------------------------ | :--------------------------------------------- | :-------------: |
22+
| [MEP-1](MEP1/README.md) | Distributed Control Plane Deployment | `In Discussion` |
23+
| [MEP-2](MEP2/README.md) | Two Factor Authentication | `Aborted` |
24+
| [MEP-3](MEP3/README.md) | Machine Re-Installation to preserve local data | `Completed` |
25+
| [MEP-4](MEP4/README.md) | Multi-tenancy for the metal-api | `Accepted` |
26+
| [MEP-5](MEP5/README.md) | Shared Networks | `Completed` |
27+
| [MEP-6](MEP6/README.md) | DMZ Networks | `Completed` |
28+
| [MEP-8](MEP8/README.md) | Configurable Filesystemlayout | `Completed` |
29+
| [MEP-9](MEP9/README.md) | No Open Ports To the Data Center | `Completed` |
30+
| [MEP-11](MEP11/README.md) | Auditing of metal-stack resources | `Completed` |
31+
| [MEP-12](MEP12/README.md) | Rack Spreading | `In Discussion` |

marp/themes/metal-stack.css

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/* @theme metal-stack */
2+
3+
@import 'gaia';
4+
@import url('https://fonts.googleapis.com/css2?family=Sorts+Mill+Goudy:ital@1&display=swap');
5+
6+
section.cover {
7+
color: white;
8+
background-image: url('https://metal-stack.io/images/background/banner-back.png') !important;
9+
}
10+
11+
section.cover footer {
12+
color: white;
13+
}
14+
15+
footer {
16+
text-align: center;
17+
}
18+
19+
blockquote {
20+
font-family: "Sorts Mill Goudy";
21+
font-style: italic;
22+
hyphens: none;
23+
text-align: center;
24+
}
25+
26+
blockquote::after, blockquote::before {
27+
content: "";
28+
position: relative;
29+
}
30+
31+
.blockquote-lead {
32+
font-family: "Sorts Mill Goudy";
33+
font-style: italic;
34+
hyphens: none;
35+
text-align: center;
36+
}
37+
38+
.blockquote-footer {
39+
font-family: "Sorts Mill Goudy";
40+
font-style: italic;
41+
font-size: 0.8em;
42+
font-variant: small-caps;
43+
color: gray;
44+
}

0 commit comments

Comments
 (0)