public static DataCenter CreateDatacenter(string locationNames) { DatacenterCharacteristics characteristics = new DatacenterCharacteristics(); List <Host> hostList = new List <Host>(); int hostId = 1; int ram = 51200; // host memory (MB) long storage = 1000000; // host storage int bw = 50000; string name = locationNames + "_DataCenter"; long mips = 500000; int pe = 6; hostList.Add(new Host() { ID = hostId, Storage = storage, Failed = false, BW = bw, Ram = ram, DataCenter = name, MIPS = mips, PE = pe, ResourceManager = ResourceUtility.SetResources(ram, storage, bw, mips, pe), VMList = new List <VM>() }); string arch = "x86"; // system architecture string os = "Linux"; // operating system if (locationNames.IndexOf(LocationNames.USA.ToString()) > -1) { characteristics = new DatacenterCharacteristics( arch, os, 1, 1, new GeoLocation(DataCenterLocations.USALong, DataCenterLocations.USALat), hostList); } else if (locationNames.IndexOf(LocationNames.Singapore.ToString()) > -1) { characteristics = new DatacenterCharacteristics( arch, os, 1, 1, new GeoLocation(DataCenterLocations.SingaporeLong, DataCenterLocations.SingaporeLat), hostList); } return(new DataCenter(name, characteristics)); }
public ServiceDatacenter(string name, DatacenterCharacteristics characteristics, VmAllocationPolicy vmAllocationPolicy, List storageList, double schedulingInterval) : base(name, characteristics, vmAllocationPolicy, storageList, schedulingInterval) { }