forked from clusto/clusto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
138 lines (94 loc) · 3.38 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
subversion test
=== A lot of this stuff has changed I'll have to update it ===
Things seem to fall into 3 general categories:
1. Equipment - Things like servers, switches, racks, routers, etc.
2. Parts - Things like NICS, ports, U (rack space), etc.
3. Resources - IP ranges/network blocks, space (U, datacenter space), etc.
These are loose categories
Kinds of matching:
1. the given key value pairs exist in Thing
2. for the given keys the values match exactly in the Thing
3. the given key/values exactly match attributes of Thing
Questions I'd like to be able to answer questions like:
* get 4 servers in datacenter Z with status == unallocated
each in a different rack
servers = []
d = clusto.getByName('datacenterZ')
racks = d.getConnectedMatching(AttributeDict(Racks.allMetaAttrs()))
for r in racks:
s = r.getConnectedMatching(Servers.allMetaAttrs() + [('status', 'unallocated')])
servers.append(s.pop())
* get console for server X
* add service W on server X to loadbalancer vip Y
clusto expressions (maybe)
-----------------------
driver:Console connected to name:server2
- return the console connected to 'server2'
driver:Server
- return all serves
driver:Server connected to name:rack002
- return servers in rack002
attr:foo,12 and driver:Server
- return servers with attr foo,12
pattern
-------
alphanumeric
* glob supported ?
* regex supported ?
pattern types
----------
name:<somename>
driver:<driver>
attr:<key,val>
operators
---------
not, or, and,
functions
---------
haskey
connected to
clusto categorization ideas
===========================
Class, Role, Service
Class is similar to the class concept from fai. The classes of a server, for
example, might include information about what software is installed on that
machine or how much ram the machine has or how many disks.
Role is a description of the job of a Thing. So a server could have the roles
of Production, LiveWebserver, and Mail. These roles are generally more
abstract and don't refer to specific software or hardware properties
themselves. The can however require that the server be a member of certain
Classes. So the Blog role might require that the server be connected to the
Webserver class while the LiveSite role would require the server be connected
to the Apache and BigMem classes.
A Service is an instance of a role. So you can have dbslave14... (not sure of
the value of this)
A Pool is just a grouping of Things. For example you could have many Servers
with a 'dbslave' role but with some in a 'production' pool and others in a
'development' pool.
(how do you put two db roles on one machine?)
( up to sysadmins. might use VMs, might use vservers (like openvz), might
put things on separate ports)
clusto command line ideas
=========================
clusto connect foo1 foo2
- connect foo1 and foo2
clusto power off server1
clusto locate server1
- should return:
server1 -> connected to port 4 on switch2a
server1 -> connected to RU13 in rack101
clusto console server1
- connect to console on server1
clusto attr del <key> [<value>]
clusto attr add <key> <value> [<value>] [<value>] ...
clusto attr get <key>
clusto attr set <key> <value> [<value>] [<value>] ...
- modify Thing attributes
clusto network setvlan server1 eth1 vlan203
- put eth1 on server1 onto vlan203
clusto rebuild server1
- reinstall operating system onto server1
Reserverd Attrs
===============
_ip
_in