@Override public void startEntity() { Log.printConcatLine(getName(), " is starting..."); // this resource should register to regional CIS. // However, if not specified, then register to system CIS (the // default CloudInformationService) entity. int gisID = CloudSim.getEntityId(regionalCisName); if (gisID == -1) { gisID = CloudSim.getCloudInfoServiceEntityId(); } // send the registration to CIS sendNow(gisID, CloudSimTags.REGISTER_RESOURCE, getId()); // Below method is for a child class to override registerOtherEntity(); }
/** * Process the event for an User/Broker who wants to destroy a VM previously created in this * Datacenter. This Datacenter may send, upon request, the status back to the * User/Broker. * * @param ev information about the event just happened * @param ack indicates if the event's sender expects to receive * an acknowledge message when the event finishes to be processed * * @pre ev != null * @post $none */ protected void processVmDestroy(SimEvent ev, boolean ack) { Vm vm = (Vm) ev.getData(); getVmAllocationPolicy().deallocateHostForVm(vm); if (ack) { int[] data = new int[3]; data[0] = getId(); data[1] = vm.getId(); data[2] = CloudSimTags.TRUE; sendNow(vm.getUserId(), CloudSimTags.VM_DESTROY_ACK, data); } getVmList().remove(vm); }
NetworkConstants.totaldatatransfer += hs.pkt.data; CloudSim.send(getDatacenter().getId(), sw.getId(), delay, CloudSimTags.Network_Event_UP, hs);
/** * Processes a Cloudlet pause request. * * @param cloudletId ID of the cloudlet to be paused * @param userId ID of the cloudlet's owner * @param ack indicates if the event's sender expects to receive * an acknowledge message when the event finishes to be processed * @param vmId the id of the VM where the cloudlet has to be paused * * @pre $none * @post $none */ protected void processCloudletPause(int cloudletId, int userId, int vmId, boolean ack) { boolean status = getVmAllocationPolicy().getHost(vmId, userId).getVm(vmId,userId) .getCloudletScheduler().cloudletPause(cloudletId); if (ack) { int[] data = new int[3]; data[0] = getId(); data[1] = cloudletId; if (status) { data[2] = CloudSimTags.TRUE; } else { data[2] = CloudSimTags.FALSE; } sendNow(userId, CloudSimTags.CLOUDLET_PAUSE_ACK, data); } }
data[0] = getId(); data[1] = vm.getId();
NetworkTopology.addLink(datacenter0.getId(), broker.getId(),10.0,10);
NetworkTopology.mapNode(datacenter0.getId(),briteNode);
schedule(getId(), (smallerTime - CloudSim.clock()), CloudSimTags.VM_DATACENTER_EVENT);
data[0] = getId(); data[1] = cl.getCloudletId(); data[2] = CloudSimTags.FALSE; getId(), getCharacteristics().getCostPerSecond(), getCharacteristics().getCostPerBw()); send(getId(), estimatedFinishTime, CloudSimTags.VM_DATACENTER_EVENT); data[0] = getId(); data[1] = cl.getCloudletId(); data[2] = CloudSimTags.TRUE;
data[0] = getId(); data[1] = vm.getId();
array[0] = getId(); array[1] = cloudletId; array[2] = status;