bug 11219: use local storage flag from service offering when it is ROOT disk

This commit is contained in:
Kelven Yang 2011-08-24 13:34:14 -07:00
parent 6c4743a8b8
commit a51383e296
1 changed files with 8 additions and 0 deletions

View File

@ -609,6 +609,14 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentPlanner {
}
} else {
useLocalStorage = diskOffering.getUseLocalStorage();
// TODO: this is a hacking fix for the problem of deploy ISO-based VM on local storage
// when deploying VM based on ISO, we have a service offering and an additional disk offering, use-local storage flag is actually
// saved in service offering, overrde the flag from service offering when it is a ROOT disk
if(!useLocalStorage && vmProfile.getServiceOffering().getUseLocalStorage()) {
if(toBeCreated.getVolumeType() == Volume.Type.ROOT)
useLocalStorage = true;
}
}
diskProfile.setUseLocalStorage(useLocalStorage);