-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME.txt
178 lines (147 loc) · 3.71 KB
/
README.txt
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
MINI PROJECT CLOUD COMPUTING
Problem Definition – Build a fabric that can coordinate the provisioning of
compute resources by negotiating with a set of Hypervisors running across
physical servers in the datacenter.
Expected Outcome –
1. Resource Discovery:
2. Resource Allocation
Decide what resources to allocate to fulfil the request. It should be loosely coupled in the
sense that mechanism and implementation should be separate. What this means is it should be
a possible to change the “Algorithm” for allocation with minimal code changes or still better with
change in configuration only.
3. A REST API Server ( that can be consumed by a variety of clients to deal with the
virtual infrastructure).
Expected API:
VM APIs:
■ VM_Creation:
● Argument: name, instance_type.
● Return: vmid(+ if successfully created, 0 if failed)
{
vmid:38201
}
● URL: http://server/vm/create?name=test_vm&instance_type=type&image_id=id
VM_Query
● Argument: vmid
● Return: instance_type, name, id, pmid (0 if invalid vmid or
otherwise)
{
"vmid":38201,
"name":"test_vm",
"instance_type":3,
"pmid": 2
}
● URL: http://server/vm/query?vmid=vmid
VM_Destroy
● Argument: vmid
● Return: 1 for success and 0 for failure.
{
“status”:1
}
● URL: http://server/vm/destroy?vmid=vmid
VM_Type
● Argument: NA
● Return: tid, cpu, ram, disk
{
"types": [
{
"tid": 1,
"cpu": 1,
"ram": 512,
"disk": 1
},
{
"tid": 2,
"cpu": 2,
"ram": 1024,
"disk": 2
},
{
"tid": 3,
"cpu": 4,
"ram": 2048,
"disk": 3 }
]
}
● URL: http://server/vm/types
Resource Service APIs:
■ List_PMs
● Argument: NA
● Return: pmids
{
“pmids”: [1,2,3]
}
● URL: http://server/pm/list
■ List_VMs
● Argument: pmid
● Return: vmids (0 if invalid)
{
“vmids”: [38201, 38203, 38205]
}
● URL:http://server/pm/listvms?pmid=id
■ PM_Query
● Argument: pmid
● Return: pmid, capacity, free, no. of VMs running(0 if invalid pmid
or otherwise)
{
“pmid”: 1,
“capacity”:{
“cpu”: 4,
“ram”: 4096,
“disk”: 160
},
“free”:{
“cpu”: 2,
“ram”: 2048,
“disk”: 157
},
“vms”: 1
}
● URL: http://server/pm/query?pmid=id
Image Service APIs:
■ List_Images
● Argument: NA
● Return: id, name
{
“images”:[
{
“id”: 100,
“name”: “Ubuntu12.04amd64”
},
{
“id”:101,
“name”: “Fedora17x86_64”
}
]
}
URL: http://server/image/list
For all the other Restful calls return 0(that is the call is invalid)
Syntax:
./script pm_file image_file flavor_file
pm_file => Contains a list of IP addresses separated by newline. These addresses the Physical
machines to be used for hosting VMs. A unique ID is to be assigned by you.
image_file => Contains a list of Images(full path) to be used for spawning VMs. The name of the
image is to be extracted from the path itself. A unique ID is to be assigned by you.
flavor_file => contains a dictionary of flavors which can be evaluated.
TECHNOLOGY STACK USED
1)FLASK
2)PYTHON
3)LIBVIRT
4)KVM
5)VIRTUAL MACHINE MANAGER-HYPERVISOR
SHEDULING POLICY USED
FIFO(first in first out)
Location and names of my files
pm_file ---> /src/pm_file
image_file ----> /src/image_file
flavor_file ----> /src/vm_types
Name of source files:
main_mini.py:
1)Handles all the function API calls except VM_CREATE and VM_DESTROY
create.py
1)Handles VM_CREATE
destroy_vm.py
1)Handles VM_DESTROY
settings.py
1)Handles all the global variables used in the entire project
linux.img:
taken from http://wiki.qemu.org/Testing