Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public long getEntityOwnerId() {

@Override
public void execute() {
CallContext.current().setEventDetails("Virtual router element Id: " + getEntityId());
CallContext.current().setEventDetails("Virtual router element Id: " + getEntityUuid());
VirtualRouterProvider result = _service.get(0).getCreatedElement(getEntityId());
if (result != null) {
VirtualRouterProviderResponse response = _responseGenerator.createVirtualRouterProviderResponse(result);
Expand Down Expand Up @@ -137,6 +137,6 @@ public String getEventType() {

@Override
public String getEventDescription() {
return "Adding physical network ServiceProvider Virtual Router: " + getEntityId();
return "Adding physical network ServiceProvider Virtual Router: " + getEntityUuid();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public String getEventType() {

@Override
public String getEventDescription() {
return "destroying router: " + getId();
return "destroying router: " + this._uuidMgr.getUuid(VirtualMachine.class,getId());
}

@Override
Expand All @@ -98,7 +98,7 @@ public Long getInstanceId() {
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
CallContext ctx = CallContext.current();
ctx.setEventDetails("Router Id: " + getId());
ctx.setEventDetails("Router Id: " + this._uuidMgr.getUuid(VirtualMachine.class,getId()));

VirtualRouter result = _routerService.destroyRouter(getId(), ctx.getCallingAccount(), ctx.getCallingUserId());
if (result != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public String getEventType() {

@Override
public String getEventDescription() {
return "rebooting router: " + getId();
return "rebooting router: " + this._uuidMgr.getUuid(VirtualMachine.class,getId());
}

@Override
Expand All @@ -98,7 +98,7 @@ public Long getInstanceId() {

@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
CallContext.current().setEventDetails("Router Id: " + getId());
CallContext.current().setEventDetails("Router Id: " + this._uuidMgr.getUuid(VirtualMachine.class,getId()));
VirtualRouter result = _routerService.rebootRouter(getId(), true);
if (result != null) {
DomainRouterResponse response = _responseGenerator.createDomainRouterResponse(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public String getEventType() {

@Override
public String getEventDescription() {
return "starting router: " + getId();
return "starting router: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
}

@Override
Expand All @@ -104,7 +104,7 @@ public Long getInstanceId() {

@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
CallContext.current().setEventDetails("Router Id: " + getId());
CallContext.current().setEventDetails("Router Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));
VirtualRouter result = null;
VirtualRouter router = _routerService.findRouter(getId());
if (router == null || router.getRole() != Role.VIRTUAL_ROUTER) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public String getEventType() {

@Override
public String getEventDescription() {
return "stopping router: " + getId();
return "Stopping router: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
}

@Override
Expand All @@ -106,7 +106,7 @@ public boolean isForced() {

@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
CallContext.current().setEventDetails("Router Id: " + getId());
CallContext.current().setEventDetails("Router Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));
VirtualRouter result = null;
VirtualRouter router = _routerService.findRouter(getId());
if (router == null || router.getRole() != Role.VIRTUAL_ROUTER) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public String getEventType() {

@Override
public String getEventDescription() {
return "destroying system vm: " + getId();
return "destroying system vm: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
}

@Override
Expand All @@ -99,7 +99,7 @@ public Long getInstanceId() {

@Override
public void execute() {
CallContext.current().setEventDetails("Vm Id: " + getId());
CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));
VirtualMachine instance = _mgr.destroySystemVM(this);
if (instance != null) {
SystemVmResponse response = _responseGenerator.createSystemVmResponse(instance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public String getEventType() {

@Override
public String getEventDescription() {
return "Attempting to migrate VM Id: " + getVirtualMachineId() + " to host Id: " + getHostId();
return "Attempting to migrate VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVirtualMachineId()) + " to host Id: " + this._uuidMgr.getUuid(Host.class, getHostId());
}

@Override
Expand All @@ -115,7 +115,7 @@ public void execute() {
throw new InvalidParameterValueException("Unable to find the host to migrate the VM, host id=" + getHostId());
}
try {
CallContext.current().setEventDetails("VM Id: " + getVirtualMachineId() + " to host Id: " + getHostId());
CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVirtualMachineId()) + " to host Id: " + this._uuidMgr.getUuid(Host.class, getHostId()));
//FIXME : Should not be calling UserVmService to migrate all types of VMs - need a generic VM layer
VirtualMachine migratedVm = _userVmService.migrateVirtualMachine(getVirtualMachineId(), destinationHost);
if (migratedVm != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public String getEventType() {

@Override
public String getEventDescription() {
return "rebooting system vm: " + getId();
return "rebooting system vm: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
}

@Override
Expand All @@ -106,7 +106,7 @@ public Long getInstanceId() {

@Override
public void execute() {
CallContext.current().setEventDetails("Vm Id: " + getId());
CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));
VirtualMachine result = _mgr.rebootSystemVM(this);
if (result != null) {
SystemVmResponse response = _responseGenerator.createSystemVmResponse(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public long getEntityOwnerId() {

@Override
public void execute() {
CallContext.current().setEventDetails("SystemVm Id: " + getId());
CallContext.current().setEventDetails("SystemVm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));

ServiceOffering serviceOffering = _entityMgr.findById(ServiceOffering.class, serviceOfferingId);
if (serviceOffering == null) {
Expand Down Expand Up @@ -140,6 +140,6 @@ public String getEventType() {

@Override
public String getEventDescription() {
return "Upgrading system vm: " + getId() + " to service offering: " + getServiceOfferingId();
return "Upgrading system vm: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()) + " to service offering: " + this._uuidMgr.getUuid(ServiceOffering.class, getServiceOfferingId());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public String getEventType() {

@Override
public String getEventDescription() {
return "starting system vm: " + getId();
return "starting system vm: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
}

@Override
Expand All @@ -110,7 +110,7 @@ public Long getInstanceId() {

@Override
public void execute() {
CallContext.current().setEventDetails("Vm Id: " + getId());
CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));
VirtualMachine instance = _mgr.startSystemVM(getId());
if (instance != null) {
SystemVmResponse response = _responseGenerator.createSystemVmResponse(instance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public String getEventType() {

@Override
public String getEventDescription() {
return "stopping system vm: " + getId();
return "stopping system vm: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
}

@Override
Expand All @@ -116,7 +116,7 @@ public boolean isForced() {

@Override
public void execute() throws ResourceUnavailableException, ConcurrentOperationException {
CallContext.current().setEventDetails("Vm Id: " + getId());
CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));
VirtualMachine result = _mgr.stopSystemVM(this);
if (result != null) {
SystemVmResponse response = _responseGenerator.createSystemVmResponse(result);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public long getEntityOwnerId() {

@Override
public void execute() {
CallContext.current().setEventDetails("Vm Id: " + getId());
CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));

ServiceOffering serviceOffering = _entityMgr.findById(ServiceOffering.class, serviceOfferingId);
if (serviceOffering == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

import java.util.List;

import com.cloud.storage.Snapshot;
import com.cloud.storage.Volume;
import org.apache.log4j.Logger;

import org.apache.cloudstack.api.APICommand;
Expand All @@ -38,7 +40,7 @@ public class CreateTemplateCmdByAdmin extends CreateTemplateCmd {

@Override
public void execute() {
CallContext.current().setEventDetails("Template Id: "+getEntityId()+((getSnapshotId() == null) ? " from volume Id: " + getVolumeId() : " from snapshot Id: " + getSnapshotId()));
CallContext.current().setEventDetails("Template Id: " + getEntityUuid()+((getSnapshotId() == null) ? " from volume Id: " + this._uuidMgr.getUuid(Volume.class, getVolumeId()) : " from snapshot Id: " + this._uuidMgr.getUuid(Snapshot.class, getSnapshotId())));
VirtualMachineTemplate template = null;
template = _templateService.createPrivateTemplate(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.ArrayList;
import java.util.EnumSet;

import com.cloud.network.Network;
import org.apache.log4j.Logger;

import org.apache.cloudstack.api.APICommand;
Expand All @@ -41,7 +42,7 @@ public class AddNicToVMCmdByAdmin extends AddNicToVMCmd {

@Override
public void execute(){
CallContext.current().setEventDetails("Vm Id: " + getVmId() + " Network Id: " + getNetworkId());
CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVmId()) + " Network Id: " + this._uuidMgr.getUuid(Network.class, getNetworkId()));
UserVm result = _userVmService.addNicToVirtualMachine(this);
ArrayList<VMDetails> dc = new ArrayList<VMDetails>();
dc.add(VMDetails.valueOf("nics"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void execute(){

if (getStartVm()) {
try {
CallContext.current().setEventDetails("Vm Id: "+getEntityId());
CallContext.current().setEventDetails("Vm Id: " + getEntityUuid());
result = _userVmService.startVirtualMachine(this);
} catch (ResourceUnavailableException ex) {
s_logger.warn("Exception: ", ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class DestroyVMCmdByAdmin extends DestroyVMCmd {

@Override
public void execute() throws ResourceUnavailableException, ConcurrentOperationException{
CallContext.current().setEventDetails("Vm Id: "+getId());
CallContext.current().setEventDetails("Vm Id: "+this._uuidMgr.getUuid(VirtualMachine.class, getId()));
UserVm result = _userVmService.destroyVm(this);

UserVmResponse response = new UserVmResponse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public String getEventType() {

@Override
public String getEventDescription() {
return "Expunging vm: " + getId();
return "Expunging vm: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
}

@Override
Expand All @@ -104,7 +104,7 @@ public Long getInstanceId() {

@Override
public void execute() throws ResourceUnavailableException, ConcurrentOperationException {
CallContext.current().setEventDetails("Vm Id: " + getId());
CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));
try {
UserVm result = _userVmService.expungeVm(this.getId());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ public String getEventType() {

@Override
public String getEventDescription() {
return "Attempting to migrate VM Id: " + getVirtualMachineId() + " to host Id: " + getHostId();
if (getHostId() != null) {
return "Attempting to migrate VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVirtualMachineId()) + " to host Id: " + this._uuidMgr.getUuid(Host.class, getHostId());
} else if (getStoragePoolId() != null) {
return "Attempting to migrate VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVirtualMachineId()) + " to storage pool Id: " + this._uuidMgr.getUuid(StoragePool.class, getStoragePoolId());
} else {
return "Attempting to migrate VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVirtualMachineId());
}
}

@Override
Expand All @@ -146,7 +152,7 @@ public void execute() {
if (destinationHost.getType() != Host.Type.Routing) {
throw new InvalidParameterValueException("The specified host(" + destinationHost.getName() + ") is not suitable to migrate the VM, please specify another one");
}
CallContext.current().setEventDetails("VM Id: " + getVirtualMachineId() + " to host Id: " + getHostId());
CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVirtualMachineId()) + ((getHostId() != null) ? " to host Id: " + this._uuidMgr.getUuid(Host.class, getHostId()) : "" ));
}

StoragePool destStoragePool = null;
Expand All @@ -155,7 +161,7 @@ public void execute() {
if (destStoragePool == null) {
throw new InvalidParameterValueException("Unable to find the storage pool to migrate the VM");
}
CallContext.current().setEventDetails("VM Id: " + getVirtualMachineId() + " to storage pool Id: " + getStoragePoolId());
CallContext.current().setEventDetails("VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVirtualMachineId()) + " to storage pool Id: " + this._uuidMgr.getUuid(StoragePool.class, getStoragePoolId()));
}

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public String getEventType() {

@Override
public String getEventDescription() {
return "Attempting to migrate VM Id: " + getVirtualMachineId() + " to host Id: " + getHostId();
return "Attempting to migrate VM Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVirtualMachineId()) + " to host Id: " + this._uuidMgr.getUuid(Host.class, getHostId());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class RebootVMCmdByAdmin extends RebootVMCmd {

@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException{
CallContext.current().setEventDetails("Vm Id: "+getId());
CallContext.current().setEventDetails("Vm Id: "+this._uuidMgr.getUuid(VirtualMachine.class, getId()));
UserVm result;
result = _userVmService.rebootVirtualMachine(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.ArrayList;
import java.util.EnumSet;

import com.cloud.vm.Nic;
import org.apache.log4j.Logger;

import org.apache.cloudstack.api.APICommand;
Expand All @@ -40,7 +41,7 @@ public class RemoveNicFromVMCmdByAdmin extends RemoveNicFromVMCmd {

@Override
public void execute(){
CallContext.current().setEventDetails("Vm Id: "+getVmId() + " Nic Id: " + getNicId());
CallContext.current().setEventDetails("Vm Id: "+this._uuidMgr.getUuid(VirtualMachine.class, getVmId()) + " Nic Id: " + this._uuidMgr.getUuid(Nic.class, getNicId()));
UserVm result = _userVmService.removeNicFromVirtualMachine(this);
ArrayList<VMDetails> dc = new ArrayList<VMDetails>();
dc.add(VMDetails.valueOf("nics"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class RestoreVMCmdByAdmin extends RestoreVMCmd {
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
ResourceAllocationException {
UserVm result;
CallContext.current().setEventDetails("Vm Id: " + getVmId());
CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVmId()));
result = _userVmService.restoreVM(this);
if (result != null) {
UserVmResponse response = _responseGenerator.createUserVmResponse(ResponseView.Full, "virtualmachine", result).get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class StartVMCmdByAdmin extends StartVMCmd {
@Override
public void execute() throws ResourceUnavailableException, ResourceAllocationException {
try {
CallContext.current().setEventDetails("Vm Id: " + getId());
CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));

UserVm result ;
result = _userVmService.startVirtualMachine(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class StopVMCmdByAdmin extends StopVMCmd {

@Override
public void execute() throws ServerApiException, ConcurrentOperationException {
CallContext.current().setEventDetails("Vm Id: " + getId());
CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));
UserVm result;

result = _userVmService.stopVirtualMachine(getId(), isForced());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.ArrayList;
import java.util.EnumSet;

import com.cloud.vm.Nic;
import org.apache.log4j.Logger;

import org.apache.cloudstack.api.APICommand;
Expand All @@ -41,7 +42,7 @@ public class UpdateDefaultNicForVMCmdByAdmin extends UpdateDefaultNicForVMCmd {

@Override
public void execute(){
CallContext.current().setEventDetails("Vm Id: "+getVmId() + " Nic Id: " + getNicId());
CallContext.current().setEventDetails("Vm Id: "+this._uuidMgr.getUuid(VirtualMachine.class, getVmId()) + " Nic Id: " + this._uuidMgr.getUuid(Nic.class, getNicId()));
UserVm result = _userVmService.updateDefaultNicForVirtualMachine(this);
ArrayList<VMDetails> dc = new ArrayList<VMDetails>();
dc.add(VMDetails.valueOf("nics"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class UpdateVMCmdByAdmin extends UpdateVMCmd {
@Override
public void execute() throws ResourceUnavailableException,
InsufficientCapacityException, ServerApiException {
CallContext.current().setEventDetails("Vm Id: "+getId());
CallContext.current().setEventDetails("Vm Id: "+this._uuidMgr.getUuid(VirtualMachine.class, getId()));
UserVm result = _userVmService.updateVirtualMachine(this);
if (result != null){
UserVmResponse response = _responseGenerator.createUserVmResponse(ResponseView.Full, "virtualmachine", result).get(0);
Expand Down
Loading