Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
gpucloudsim
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
LPDS
gpucloudsim
Commits
8a9bd8f0
Commit
8a9bd8f0
authored
Feb 09, 2011
by
Anton Beloglazov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a bug in PowerVmAllocationPolicySingleThreshold::optimizeAllocation()
parent
0408e710
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
16 deletions
+16
-16
PowerVmAllocationPolicySingleThreshold.java
...loudsim/power/PowerVmAllocationPolicySingleThreshold.java
+16
-16
No files found.
modules/cloudsim/src/main/java/org/cloudbus/cloudsim/power/PowerVmAllocationPolicySingleThreshold.java
View file @
8a9bd8f0
...
...
@@ -153,31 +153,31 @@ public class PowerVmAllocationPolicySingleThreshold extends VmAllocationPolicySi
List
<
Vm
>
vmsToRestore
=
new
ArrayList
<
Vm
>();
vmsToRestore
.
addAll
(
vmList
);
List
<
Vm
>
vmTmpList
=
new
ArrayList
<
Vm
>();
vmTmpList
.
addAll
(
vmList
);
PowerVmList
.
sortByCpuUtilization
(
vmTmpList
);
List
<
Vm
>
vmsToMigrate
=
new
ArrayList
<
Vm
>();
for
(
Vm
vm
:
vmList
)
{
if
(
vm
.
isRecentlyCreated
()
||
vm
.
isInMigration
())
{
continue
;
}
vmsToMigrate
.
add
(
vm
);
vm
.
getHost
().
vmDestroy
(
vm
);
}
PowerVmList
.
sortByCpuUtilization
(
vmsToMigrate
);
for
(
PowerHost
host
:
this
.<
PowerHost
>
getHostList
())
{
host
.
reallocateMigratingVms
();
}
for
(
Vm
vm
:
vmTmpList
)
{
if
(
vm
.
isRecentlyCreated
()
||
vm
.
isInMigration
())
{
continue
;
}
for
(
Vm
vm
:
vmsToMigrate
)
{
PowerHost
oldHost
=
(
PowerHost
)
getVmTable
().
get
(
vm
.
getUid
());
PowerHost
allocatedHost
=
findHostForVm
(
vm
);
if
(
allocatedHost
!=
null
)
{
Log
.
printLine
(
"VM #"
+
vm
.
getId
()
+
" allocated to host #"
+
allocatedHost
.
getId
());
if
(
allocatedHost
!=
null
&&
allocatedHost
.
getId
()
!=
oldHost
.
getId
())
{
allocatedHost
.
vmCreate
(
vm
);
Log
.
printLine
(
"VM #"
+
vm
.
getId
()
+
" allocated to host #"
+
allocatedHost
.
getId
());
if
(
allocatedHost
.
getId
()
!=
oldHost
.
getId
())
{
Map
<
String
,
Object
>
migrate
=
new
HashMap
<
String
,
Object
>();
migrate
.
put
(
"vm"
,
vm
);
migrate
.
put
(
"host"
,
allocatedHost
);
migrationMap
.
add
(
migrate
);
}
Map
<
String
,
Object
>
migrate
=
new
HashMap
<
String
,
Object
>();
migrate
.
put
(
"vm"
,
vm
);
migrate
.
put
(
"host"
,
allocatedHost
);
migrationMap
.
add
(
migrate
);
}
}
...
...
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