mirror of https://github.com/apache/cloudstack.git
changed getName to getHostname
This commit is contained in:
parent
f5cc308e77
commit
99bc15f64a
|
|
@ -178,9 +178,9 @@ public interface VirtualMachine extends RunningOn, ControlledEntity, StateObject
|
|||
/**
|
||||
* @return the host name of the virtual machine. If the user did not
|
||||
* specify the host name when creating the virtual machine then it is
|
||||
* the name generated by cloud stack.
|
||||
* defaults to the instance name.
|
||||
*/
|
||||
public String getName();
|
||||
public String getHostName();
|
||||
|
||||
/**
|
||||
* @return the ip address of the virtual machine.
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class UserVmVO extends VMInstanceVO implements UserVm {
|
|||
String name) {
|
||||
super(id, serviceOfferingId, name, instanceName, Type.User, templateId, hypervisorType, guestOsId, domainId, accountId, haEnabled, limitCpuUse);
|
||||
this.userData = userData;
|
||||
this.displayName = displayName != null ? displayName : null;
|
||||
this.displayName = displayName != null ? displayName : name != null ? name : instanceName;
|
||||
this.details = new HashMap<String, String>();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
|||
protected long id;
|
||||
|
||||
@Column(name="name", updatable=false, nullable=false, length=255)
|
||||
protected String name = null;
|
||||
protected String hostName = null;
|
||||
|
||||
@Column(name="vnc_password", updatable=true, nullable=false, length=255)
|
||||
protected String vncPassword;
|
||||
|
|
@ -152,7 +152,7 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
|||
long accountId,
|
||||
boolean haEnabled) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.hostName = name != null ? name : instanceName;
|
||||
if (vmTemplateId != null) {
|
||||
this.templateId = vmTemplateId;
|
||||
}
|
||||
|
|
@ -236,8 +236,8 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
public String getHostName() {
|
||||
return hostName;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -245,10 +245,6 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
|||
return instanceName;
|
||||
}
|
||||
|
||||
public void setInstanceName(String instanceName) {
|
||||
this.instanceName = instanceName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public State getState() {
|
||||
return state;
|
||||
|
|
@ -339,7 +335,8 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject<State, Vi
|
|||
return lastHostId;
|
||||
}
|
||||
|
||||
public void setLastHostId(Long lastHostId) {
|
||||
@Override
|
||||
public void setLastHostId(Long lastHostId) {
|
||||
this.lastHostId = lastHostId;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,21 +60,21 @@ public class ConsoleProxyAlertAdapter implements AlertAdapter {
|
|||
case ConsoleProxyAlertEventArgs.PROXY_CREATED :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("New console proxy created, zone: " + dc.getName() + ", proxy: " +
|
||||
proxy.getName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
proxy.getPrivateIpAddress());
|
||||
break;
|
||||
|
||||
case ConsoleProxyAlertEventArgs.PROXY_UP :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Console proxy is up, zone: " + dc.getName() + ", proxy: " +
|
||||
proxy.getName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
proxy.getPrivateIpAddress());
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.ALERT_TYPE_CONSOLE_PROXY,
|
||||
args.getZoneId(),
|
||||
proxy.getPodId(),
|
||||
"Console proxy up in zone: " + dc.getName() + ", proxy: " + proxy.getName() + ", public IP: " + proxy.getPublicIpAddress()
|
||||
"Console proxy up in zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress()
|
||||
+ ", private IP: " + (proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()),
|
||||
"Console proxy up (zone " + dc.getName() + ")"
|
||||
);
|
||||
|
|
@ -83,14 +83,14 @@ public class ConsoleProxyAlertAdapter implements AlertAdapter {
|
|||
case ConsoleProxyAlertEventArgs.PROXY_DOWN :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Console proxy is down, zone: " + dc.getName() + ", proxy: " +
|
||||
proxy.getName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
(proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()));
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.ALERT_TYPE_CONSOLE_PROXY,
|
||||
args.getZoneId(),
|
||||
proxy.getPodId(),
|
||||
"Console proxy down in zone: " + dc.getName() + ", proxy: " + proxy.getName() + ", public IP: " + proxy.getPublicIpAddress()
|
||||
"Console proxy down in zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress()
|
||||
+ ", private IP: " + (proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()),
|
||||
"Console proxy down (zone " + dc.getName() + ")"
|
||||
);
|
||||
|
|
@ -99,14 +99,14 @@ public class ConsoleProxyAlertAdapter implements AlertAdapter {
|
|||
case ConsoleProxyAlertEventArgs.PROXY_REBOOTED :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Console proxy is rebooted, zone: " + dc.getName() + ", proxy: " +
|
||||
proxy.getName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
(proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()));
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.ALERT_TYPE_CONSOLE_PROXY,
|
||||
args.getZoneId(),
|
||||
proxy.getPodId(),
|
||||
"Console proxy rebooted in zone: " + dc.getName() + ", proxy: " + proxy.getName() + ", public IP: " + proxy.getPublicIpAddress()
|
||||
"Console proxy rebooted in zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress()
|
||||
+ ", private IP: " + (proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()),
|
||||
"Console proxy rebooted (zone " + dc.getName() + ")"
|
||||
);
|
||||
|
|
@ -115,14 +115,14 @@ public class ConsoleProxyAlertAdapter implements AlertAdapter {
|
|||
case ConsoleProxyAlertEventArgs.PROXY_CREATE_FAILURE :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Console proxy creation failure, zone: " + dc.getName() + ", proxy: " +
|
||||
proxy.getName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
(proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()));
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.ALERT_TYPE_CONSOLE_PROXY,
|
||||
args.getZoneId(),
|
||||
proxy.getPodId(),
|
||||
"Console proxy creation failure. zone: " + dc.getName() + ", proxy: " + proxy.getName() + ", public IP: " + proxy.getPublicIpAddress()
|
||||
"Console proxy creation failure. zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress()
|
||||
+ ", private IP: " + (proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress())
|
||||
+ ", error details: " + args.getMessage(),
|
||||
"Console proxy creation failure (zone " + dc.getName() + ")"
|
||||
|
|
@ -132,14 +132,14 @@ public class ConsoleProxyAlertAdapter implements AlertAdapter {
|
|||
case ConsoleProxyAlertEventArgs.PROXY_START_FAILURE :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Console proxy startup failure, zone: " + dc.getName() + ", proxy: " +
|
||||
proxy.getName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
(proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()));
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.ALERT_TYPE_CONSOLE_PROXY,
|
||||
args.getZoneId(),
|
||||
proxy.getPodId(),
|
||||
"Console proxy startup failure. zone: " + dc.getName() + ", proxy: " + proxy.getName() + ", public IP: " + proxy.getPublicIpAddress()
|
||||
"Console proxy startup failure. zone: " + dc.getName() + ", proxy: " + proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress()
|
||||
+ ", private IP: " + (proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress())
|
||||
+ ", error details: " + args.getMessage(),
|
||||
"Console proxy startup failure (zone " + dc.getName() + ")"
|
||||
|
|
@ -149,14 +149,14 @@ public class ConsoleProxyAlertAdapter implements AlertAdapter {
|
|||
case ConsoleProxyAlertEventArgs.PROXY_FIREWALL_ALERT :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Console proxy firewall alert, zone: " + dc.getName() + ", proxy: " +
|
||||
proxy.getName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
(proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()));
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.ALERT_TYPE_CONSOLE_PROXY,
|
||||
args.getZoneId(),
|
||||
proxy.getPodId(),
|
||||
"Failed to open console proxy firewall port. zone: " + dc.getName() + ", proxy: " + proxy.getName()
|
||||
"Failed to open console proxy firewall port. zone: " + dc.getName() + ", proxy: " + proxy.getHostName()
|
||||
+ ", public IP: " + proxy.getPublicIpAddress()
|
||||
+ ", private IP: " + (proxy.getPrivateIpAddress() == null ? "N/A" : proxy.getPrivateIpAddress()),
|
||||
"Console proxy alert (zone " + dc.getName() + ")"
|
||||
|
|
@ -166,7 +166,7 @@ public class ConsoleProxyAlertAdapter implements AlertAdapter {
|
|||
case ConsoleProxyAlertEventArgs.PROXY_STORAGE_ALERT :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Console proxy storage alert, zone: " + dc.getName() + ", proxy: " +
|
||||
proxy.getName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
proxy.getHostName() + ", public IP: " + proxy.getPublicIpAddress() + ", private IP: " +
|
||||
proxy.getPrivateIpAddress() + ", message: " + args.getMessage());
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
|
|
|
|||
|
|
@ -60,21 +60,21 @@ public class SecondaryStorageVmAlertAdapter implements AlertAdapter {
|
|||
case SecStorageVmAlertEventArgs.SSVM_CREATED :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("New secondary storage vm created, zone: " + dc.getName() + ", secStorageVm: " +
|
||||
secStorageVm.getName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
secStorageVm.getPrivateIpAddress());
|
||||
break;
|
||||
|
||||
case SecStorageVmAlertEventArgs.SSVM_UP :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Secondary Storage Vm is up, zone: " + dc.getName() + ", secStorageVm: " +
|
||||
secStorageVm.getName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
secStorageVm.getPrivateIpAddress());
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.ALERT_TYPE_SSVM,
|
||||
args.getZoneId(),
|
||||
secStorageVm.getPodId(),
|
||||
"Secondary Storage Vm up in zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getName() + ", public IP: " + secStorageVm.getPublicIpAddress()
|
||||
"Secondary Storage Vm up in zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress()
|
||||
+ ", private IP: " + (secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()),
|
||||
"Secondary Storage Vm up (zone " + dc.getName() + ")"
|
||||
);
|
||||
|
|
@ -83,14 +83,14 @@ public class SecondaryStorageVmAlertAdapter implements AlertAdapter {
|
|||
case SecStorageVmAlertEventArgs.SSVM_DOWN :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Secondary Storage Vm is down, zone: " + dc.getName() + ", secStorageVm: " +
|
||||
secStorageVm.getName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
(secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()));
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.ALERT_TYPE_SSVM,
|
||||
args.getZoneId(),
|
||||
secStorageVm.getPodId(),
|
||||
"Secondary Storage Vm down in zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getName() + ", public IP: " + secStorageVm.getPublicIpAddress()
|
||||
"Secondary Storage Vm down in zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress()
|
||||
+ ", private IP: " + (secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()),
|
||||
"Secondary Storage Vm down (zone " + dc.getName() + ")"
|
||||
);
|
||||
|
|
@ -99,14 +99,14 @@ public class SecondaryStorageVmAlertAdapter implements AlertAdapter {
|
|||
case SecStorageVmAlertEventArgs.SSVM_REBOOTED :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Secondary Storage Vm is rebooted, zone: " + dc.getName() + ", secStorageVm: " +
|
||||
secStorageVm.getName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
(secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()));
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.ALERT_TYPE_SSVM,
|
||||
args.getZoneId(),
|
||||
secStorageVm.getPodId(),
|
||||
"Secondary Storage Vm rebooted in zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getName() + ", public IP: " + secStorageVm.getPublicIpAddress()
|
||||
"Secondary Storage Vm rebooted in zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress()
|
||||
+ ", private IP: " + (secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()),
|
||||
"Secondary Storage Vm rebooted (zone " + dc.getName() + ")"
|
||||
);
|
||||
|
|
@ -115,14 +115,14 @@ public class SecondaryStorageVmAlertAdapter implements AlertAdapter {
|
|||
case SecStorageVmAlertEventArgs.SSVM_CREATE_FAILURE :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Secondary Storage Vm creation failure, zone: " + dc.getName() + ", secStorageVm: " +
|
||||
secStorageVm.getName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
(secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()));
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.ALERT_TYPE_SSVM,
|
||||
args.getZoneId(),
|
||||
secStorageVm.getPodId(),
|
||||
"Secondary Storage Vm creation failure. zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getName() + ", public IP: " + secStorageVm.getPublicIpAddress()
|
||||
"Secondary Storage Vm creation failure. zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress()
|
||||
+ ", private IP: " + (secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress())
|
||||
+ ", error details: " + args.getMessage(),
|
||||
"Secondary Storage Vm creation failure (zone " + dc.getName() + ")"
|
||||
|
|
@ -132,14 +132,14 @@ public class SecondaryStorageVmAlertAdapter implements AlertAdapter {
|
|||
case SecStorageVmAlertEventArgs.SSVM_START_FAILURE :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Secondary Storage Vm startup failure, zone: " + dc.getName() + ", secStorageVm: " +
|
||||
secStorageVm.getName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
(secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()));
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.ALERT_TYPE_SSVM,
|
||||
args.getZoneId(),
|
||||
secStorageVm.getPodId(),
|
||||
"Secondary Storage Vm startup failure. zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getName() + ", public IP: " + secStorageVm.getPublicIpAddress()
|
||||
"Secondary Storage Vm startup failure. zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress()
|
||||
+ ", private IP: " + (secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress())
|
||||
+ ", error details: " + args.getMessage(),
|
||||
"Secondary Storage Vm startup failure (zone " + dc.getName() + ")"
|
||||
|
|
@ -149,14 +149,14 @@ public class SecondaryStorageVmAlertAdapter implements AlertAdapter {
|
|||
case SecStorageVmAlertEventArgs.SSVM_FIREWALL_ALERT :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Secondary Storage Vm firewall alert, zone: " + dc.getName() + ", secStorageVm: " +
|
||||
secStorageVm.getName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
(secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()));
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
AlertManager.ALERT_TYPE_SSVM,
|
||||
args.getZoneId(),
|
||||
secStorageVm.getPodId(),
|
||||
"Failed to open secondary storage vm firewall port. zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getName()
|
||||
"Failed to open secondary storage vm firewall port. zone: " + dc.getName() + ", secStorageVm: " + secStorageVm.getHostName()
|
||||
+ ", public IP: " + secStorageVm.getPublicIpAddress()
|
||||
+ ", private IP: " + (secStorageVm.getPrivateIpAddress() == null ? "N/A" : secStorageVm.getPrivateIpAddress()),
|
||||
"Secondary Storage Vm alert (zone " + dc.getName() + ")"
|
||||
|
|
@ -166,7 +166,7 @@ public class SecondaryStorageVmAlertAdapter implements AlertAdapter {
|
|||
case SecStorageVmAlertEventArgs.SSVM_STORAGE_ALERT :
|
||||
if(s_logger.isDebugEnabled())
|
||||
s_logger.debug("Secondary Storage Vm storage alert, zone: " + dc.getName() + ", secStorageVm: " +
|
||||
secStorageVm.getName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
secStorageVm.getHostName() + ", public IP: " + secStorageVm.getPublicIpAddress() + ", private IP: " +
|
||||
secStorageVm.getPrivateIpAddress() + ", message: " + args.getMessage());
|
||||
|
||||
_alertMgr.sendAlert(
|
||||
|
|
|
|||
|
|
@ -649,7 +649,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
if (ipAddress.getAssociatedWithVmId() != null) {
|
||||
UserVm vm = ApiDBUtils.findUserVmById(ipAddress.getAssociatedWithVmId());
|
||||
ipResponse.setVirtualMachineId(vm.getId());
|
||||
ipResponse.setVirtualMachineName(vm.getName());
|
||||
ipResponse.setVirtualMachineName(vm.getHostName());
|
||||
ipResponse.setVirtualMachineDisplayName(vm.getDisplayName());
|
||||
}
|
||||
|
||||
|
|
@ -794,7 +794,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
if (instanceId != null && volume.getState() != Volume.State.Destroy) {
|
||||
VMInstanceVO vm = ApiDBUtils.findVMInstanceById(instanceId);
|
||||
volResponse.setVirtualMachineId(vm.getId());
|
||||
volResponse.setVirtualMachineName(vm.getName());
|
||||
volResponse.setVirtualMachineName(vm.getHostName());
|
||||
UserVm userVm = ApiDBUtils.findUserVmById(vm.getId());
|
||||
volResponse.setVirtualMachineDisplayName(userVm.getDisplayName());
|
||||
|
||||
|
|
@ -964,7 +964,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
UserVm vm = ApiDBUtils.findUserVmById(fwRule.getVirtualMachineId());
|
||||
if (vm != null) {
|
||||
response.setVirtualMachineId(vm.getId());
|
||||
response.setVirtualMachineName(vm.getName());
|
||||
response.setVirtualMachineName(vm.getHostName());
|
||||
response.setVirtualMachineDisplayName(vm.getDisplayName());
|
||||
}
|
||||
}
|
||||
|
|
@ -992,7 +992,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
UserVm vm = ApiDBUtils.findUserVmById(ip.getAssociatedWithVmId());
|
||||
if (vm != null) {// vm might be destroyed
|
||||
response.setVirtualMachineId(vm.getId());
|
||||
response.setVirtualMachineName(vm.getName());
|
||||
response.setVirtualMachineName(vm.getHostName());
|
||||
response.setVirtualMachineDisplayName(vm.getDisplayName());
|
||||
}
|
||||
}
|
||||
|
|
@ -1031,7 +1031,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
}
|
||||
|
||||
userVmResponse.setId(userVm.getId());
|
||||
userVmResponse.setName(userVm.getName());
|
||||
userVmResponse.setName(userVm.getHostName());
|
||||
userVmResponse.setCreated(userVm.getCreated());
|
||||
|
||||
if (userVm.getState() != null) {
|
||||
|
|
@ -1043,7 +1043,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
if (userVm.getDisplayName() != null) {
|
||||
userVmResponse.setDisplayName(userVm.getDisplayName());
|
||||
} else {
|
||||
userVmResponse.setDisplayName(userVm.getName());
|
||||
userVmResponse.setDisplayName(userVm.getHostName());
|
||||
}
|
||||
|
||||
InstanceGroupVO group = ApiDBUtils.findInstanceGroupForVM(userVm.getId());
|
||||
|
|
@ -1221,7 +1221,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
DomainRouterResponse routerResponse = new DomainRouterResponse();
|
||||
routerResponse.setId(router.getId());
|
||||
routerResponse.setZoneId(router.getDataCenterId());
|
||||
routerResponse.setName(router.getName());
|
||||
routerResponse.setName(router.getHostName());
|
||||
routerResponse.setPodId(router.getPodId());
|
||||
routerResponse.setTemplateId(router.getTemplateId());
|
||||
routerResponse.setCreated(router.getCreated());
|
||||
|
|
@ -1284,7 +1284,7 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||
vmResponse.setSystemVmType(vm.getType().toString().toLowerCase());
|
||||
vmResponse.setZoneId(vm.getDataCenterId());
|
||||
|
||||
vmResponse.setName(vm.getName());
|
||||
vmResponse.setName(vm.getHostName());
|
||||
vmResponse.setPodId(vm.getPodId());
|
||||
vmResponse.setTemplateId(vm.getTemplateId());
|
||||
vmResponse.setCreated(vm.getCreated());
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ public class AgentBasedConsoleProxyManager implements ConsoleProxyManager, Virtu
|
|||
if (vm.getHostId() == null) {
|
||||
return -1;
|
||||
}
|
||||
GetVncPortAnswer answer = (GetVncPortAnswer) _agentMgr.easySend(vm.getHostId(), new GetVncPortCommand(vm.getId(), vm.getName()));
|
||||
GetVncPortAnswer answer = (GetVncPortAnswer) _agentMgr.easySend(vm.getHostId(), new GetVncPortCommand(vm.getId(), vm.getHostName()));
|
||||
return (answer == null || !answer.getResult()) ? -1 : answer.getPort();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||
return null;
|
||||
} else {
|
||||
if (s_logger.isTraceEnabled()) {
|
||||
s_logger.trace("Console proxy " + proxy.getName() + " is started");
|
||||
s_logger.trace("Console proxy " + proxy.getHostName() + " is started");
|
||||
}
|
||||
|
||||
// if it is a new assignment or a changed assignment,
|
||||
|
|
@ -557,7 +557,7 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||
if (s_logger.isTraceEnabled()) {
|
||||
s_logger.trace("Running proxy pool size : " + runningList.size());
|
||||
for (ConsoleProxyVO proxy : runningList) {
|
||||
s_logger.trace("Running proxy instance : " + proxy.getName());
|
||||
s_logger.trace("Running proxy instance : " + proxy.getHostName());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -993,7 +993,7 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||
|
||||
if (proxy != null) {
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
s_logger.info("Console proxy " + proxy.getName() + " is started");
|
||||
s_logger.info("Console proxy " + proxy.getHostName() + " is started");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1100,7 +1100,7 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||
try {
|
||||
return _itMgr.stop(proxy, _accountMgr.getSystemUser(), _accountMgr.getSystemAccount());
|
||||
} catch (ResourceUnavailableException e) {
|
||||
s_logger.warn("Stopping console proxy " + proxy.getName() + " failed : exception " + e.toString());
|
||||
s_logger.warn("Stopping console proxy " + proxy.getHostName() + " failed : exception " + e.toString());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1195,7 +1195,7 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||
|
||||
if (answer != null && answer.getResult()) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Successfully reboot console proxy " + proxy.getName());
|
||||
s_logger.debug("Successfully reboot console proxy " + proxy.getHostName());
|
||||
}
|
||||
|
||||
SubscriptionMgr.getInstance().notifySubscribers(ConsoleProxyManager.ALERT_SUBJECT, this,
|
||||
|
|
@ -1204,7 +1204,7 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||
return true;
|
||||
} else {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("failed to reboot console proxy : " + proxy.getName());
|
||||
s_logger.debug("failed to reboot console proxy : " + proxy.getHostName());
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
@ -1363,7 +1363,7 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||
buf.append(" template=domP type=consoleproxy");
|
||||
buf.append(" host=").append(_mgmt_host);
|
||||
buf.append(" port=").append(_mgmt_port);
|
||||
buf.append(" name=").append(profile.getVirtualMachine().getName());
|
||||
buf.append(" name=").append(profile.getVirtualMachine().getHostName());
|
||||
if (_sslEnabled) {
|
||||
buf.append(" premium=true");
|
||||
}
|
||||
|
|
@ -1516,7 +1516,7 @@ public class ConsoleProxyManagerImpl implements ConsoleProxyManager, ConsoleProx
|
|||
long proxyVmId = startupCmd.getProxyVmId();
|
||||
ConsoleProxyVO consoleProxy = _consoleProxyDao.findById(proxyVmId);
|
||||
assert(consoleProxy != null);
|
||||
HostVO consoleProxyHost = _hostDao.findConsoleProxyHost(consoleProxy.getName(), Type.ConsoleProxy);
|
||||
HostVO consoleProxyHost = _hostDao.findConsoleProxyHost(consoleProxy.getHostName(), Type.ConsoleProxy);
|
||||
|
||||
Answer answer = _agentMgr.send(consoleProxyHost.getId(), cmd);
|
||||
if(answer == null || !answer.getResult()) {
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ public class HighAvailabilityManagerImpl implements HighAvailabilityManager, Clu
|
|||
for (int i = 1; i < vms.size(); i++) {
|
||||
vm = vms.get(i);
|
||||
if (vm.isHaEnabled()) {
|
||||
sb.append(" " + vm.getName());
|
||||
sb.append(" " + vm.getHostName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -216,7 +216,7 @@ public class HighAvailabilityManagerImpl implements HighAvailabilityManager, Clu
|
|||
|
||||
for (final VMInstanceVO vm : vms) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Notifying HA Mgr of to restart vm " + vm.getId() + "-" + vm.getName());
|
||||
s_logger.debug("Notifying HA Mgr of to restart vm " + vm.getId() + "-" + vm.getHostName());
|
||||
}
|
||||
scheduleRestart(vm, investigate);
|
||||
}
|
||||
|
|
@ -274,8 +274,8 @@ public class HighAvailabilityManagerImpl implements HighAvailabilityManager, Clu
|
|||
|
||||
if (!(_forceHA || vm.isHaEnabled())) {
|
||||
String hostDesc = "id:" + vm.getHostId() + ", availability zone id:" + vm.getDataCenterId() + ", pod id:" + vm.getPodId();
|
||||
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodId(), "VM (name: " + vm.getName() + ", id: " + vm.getId() + ") stopped unexpectedly on host " + hostDesc,
|
||||
"Virtual Machine " + vm.getName() + " (id: " + vm.getId() + ") running on host [" + vm.getHostId() + "] stopped unexpectedly.");
|
||||
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodId(), "VM (name: " + vm.getHostName() + ", id: " + vm.getId() + ") stopped unexpectedly on host " + hostDesc,
|
||||
"Virtual Machine " + vm.getHostName() + " (id: " + vm.getId() + ") running on host [" + vm.getHostId() + "] stopped unexpectedly.");
|
||||
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("VM is not HA enabled so we're done.");
|
||||
|
|
@ -393,7 +393,7 @@ public class HighAvailabilityManagerImpl implements HighAvailabilityManager, Clu
|
|||
} else if (!alive) {
|
||||
fenced = true;
|
||||
} else {
|
||||
s_logger.debug("VM " + vm.getName() + " is found to be alive by " + investigator.getName());
|
||||
s_logger.debug("VM " + vm.getHostName() + " is found to be alive by " + investigator.getName());
|
||||
if (host.getStatus() == Status.Up) {
|
||||
s_logger.info(vm + " is alive and host is up. No need to restart it.");
|
||||
return null;
|
||||
|
|
@ -405,8 +405,8 @@ public class HighAvailabilityManagerImpl implements HighAvailabilityManager, Clu
|
|||
|
||||
if (!fenced) {
|
||||
s_logger.debug("We were unable to fence off the VM " + vm);
|
||||
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodId(), "Unable to restart " + vm.getName() + " which was running on host " + hostDesc,
|
||||
"Insufficient capacity to restart VM, name: " + vm.getName() + ", id: " + vmId + " which was running on host " + hostDesc);
|
||||
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodId(), "Unable to restart " + vm.getHostName() + " which was running on host " + hostDesc,
|
||||
"Insufficient capacity to restart VM, name: " + vm.getHostName() + ", id: " + vmId + " which was running on host " + hostDesc);
|
||||
return (System.currentTimeMillis() >> 10) + _restartRetryInterval;
|
||||
}
|
||||
|
||||
|
|
@ -463,20 +463,20 @@ public class HighAvailabilityManagerImpl implements HighAvailabilityManager, Clu
|
|||
}
|
||||
} catch (final InsufficientCapacityException e) {
|
||||
s_logger.warn("Unable to restart " + vm.toString() + " due to " + e.getMessage());
|
||||
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodId(), "Unable to restart " + vm.getName() + " which was running on host " + hostDesc,
|
||||
"Insufficient capacity to restart VM, name: " + vm.getName() + ", id: " + vmId + " which was running on host " + hostDesc);
|
||||
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodId(), "Unable to restart " + vm.getHostName() + " which was running on host " + hostDesc,
|
||||
"Insufficient capacity to restart VM, name: " + vm.getHostName() + ", id: " + vmId + " which was running on host " + hostDesc);
|
||||
} catch (final ResourceUnavailableException e) {
|
||||
s_logger.warn("Unable to restart " + vm.toString() + " due to " + e.getMessage());
|
||||
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodId(), "Unable to restart " + vm.getName() + " which was running on host " + hostDesc,
|
||||
"The Storage is unavailable for trying to restart VM, name: " + vm.getName() + ", id: " + vmId + " which was running on host " + hostDesc);
|
||||
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodId(), "Unable to restart " + vm.getHostName() + " which was running on host " + hostDesc,
|
||||
"The Storage is unavailable for trying to restart VM, name: " + vm.getHostName() + ", id: " + vmId + " which was running on host " + hostDesc);
|
||||
} catch (ConcurrentOperationException e) {
|
||||
s_logger.warn("Unable to restart " + vm.toString() + " due to " + e.getMessage());
|
||||
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodId(), "Unable to restart " + vm.getName() + " which was running on host " + hostDesc,
|
||||
"The Storage is unavailable for trying to restart VM, name: " + vm.getName() + ", id: " + vmId + " which was running on host " + hostDesc);
|
||||
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodId(), "Unable to restart " + vm.getHostName() + " which was running on host " + hostDesc,
|
||||
"The Storage is unavailable for trying to restart VM, name: " + vm.getHostName() + ", id: " + vmId + " which was running on host " + hostDesc);
|
||||
} catch (OperationTimedoutException e) {
|
||||
s_logger.warn("Unable to restart " + vm.toString() + " due to " + e.getMessage());
|
||||
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodId(), "Unable to restart " + vm.getName() + " which was running on host " + hostDesc,
|
||||
"The Storage is unavailable for trying to restart VM, name: " + vm.getName() + ", id: " + vmId + " which was running on host " + hostDesc);
|
||||
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodId(), "Unable to restart " + vm.getHostName() + " which was running on host " + hostDesc,
|
||||
"The Storage is unavailable for trying to restart VM, name: " + vm.getHostName() + ", id: " + vmId + " which was running on host " + hostDesc);
|
||||
}
|
||||
vm = _itMgr.findById(vm.getType(), vm.getId());
|
||||
work.setUpdateTime(vm.getUpdated());
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ public class UserVmDomRInvestigator extends AbstractInvestigatorImpl {
|
|||
Answer pingTestAnswer = _agentMgr.send(hostId, new PingTestCommand(routerPrivateIp, privateIp), 30 * 1000);
|
||||
if (pingTestAnswer.getResult()) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("user vm " + vm.getName() + " has been successfully pinged, returning that it is alive");
|
||||
s_logger.debug("user vm " + vm.getHostName() + " has been successfully pinged, returning that it is alive");
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -582,13 +582,13 @@ public class Db20to21MigrationUtil {
|
|||
String guestMacAddress = macAddresses[0];
|
||||
|
||||
if(proxy.getState() == State.Running || proxy.getState() == State.Starting) {
|
||||
System.out.println("System VM " + proxy.getName() + " is in active state, mark it to Stopping state for migration");
|
||||
System.out.println("System VM " + proxy.getHostName() + " is in active state, mark it to Stopping state for migration");
|
||||
proxy.setState(State.Stopping);
|
||||
}
|
||||
|
||||
String guestIpAddress = _dcDao.allocateLinkLocalIpAddress(proxy.getDataCenterId(), proxy.getPodId(), proxy.getId(), null);
|
||||
|
||||
System.out.println("Assign link loal address to proxy " + proxy.getName() + ", link local address: " + guestIpAddress);
|
||||
System.out.println("Assign link loal address to proxy " + proxy.getHostName() + ", link local address: " + guestIpAddress);
|
||||
_consoleProxyDao.update(proxy.getId(), proxy);
|
||||
}
|
||||
|
||||
|
|
@ -606,13 +606,13 @@ public class Db20to21MigrationUtil {
|
|||
String guestMacAddress = macAddresses[0];
|
||||
|
||||
if(secStorageVm.getState() == State.Running || secStorageVm.getState() == State.Starting) {
|
||||
System.out.println("System VM " + secStorageVm.getName() + " is in active state, mark it to Stopping state for migration");
|
||||
System.out.println("System VM " + secStorageVm.getHostName() + " is in active state, mark it to Stopping state for migration");
|
||||
secStorageVm.setState(State.Stopping);
|
||||
}
|
||||
|
||||
String guestIpAddress = _dcDao.allocateLinkLocalIpAddress(secStorageVm.getDataCenterId(), secStorageVm.getPodId(), secStorageVm.getId(), null);
|
||||
|
||||
System.out.println("Assign link loal address to secondary storage VM " + secStorageVm.getName() + ", link local address: " + guestIpAddress);
|
||||
System.out.println("Assign link loal address to secondary storage VM " + secStorageVm.getHostName() + ", link local address: " + guestIpAddress);
|
||||
_secStorageVmDao.update(secStorageVm.getId(), secStorageVm);
|
||||
}
|
||||
|
||||
|
|
@ -629,7 +629,7 @@ public class Db20to21MigrationUtil {
|
|||
if(router.getState() == State.Running || router.getState() == State.Starting) {
|
||||
router.setState(State.Stopping);
|
||||
|
||||
System.out.println("System VM " + router.getName() + " is in active state, mark it to Stopping state for migration");
|
||||
System.out.println("System VM " + router.getHostName() + " is in active state, mark it to Stopping state for migration");
|
||||
_routerDao.update(router.getId(), router);
|
||||
}
|
||||
}
|
||||
|
|
@ -693,11 +693,11 @@ public class Db20to21MigrationUtil {
|
|||
deviceId = 1; // reset for each VM iteration
|
||||
for(VolumeVO vol : volumes) {
|
||||
if(vol.getVolumeType() == Volume.Type.ROOT) {
|
||||
System.out.println("Setting root volume device id to zero, vol: " + vol.getName() + ", instance: " + vm.getName());
|
||||
System.out.println("Setting root volume device id to zero, vol: " + vol.getName() + ", instance: " + vm.getHostName());
|
||||
|
||||
vol.setDeviceId(0L);
|
||||
} else if(vol.getVolumeType() == Volume.Type.DATADISK) {
|
||||
System.out.println("Setting data volume device id, vol: " + vol.getName() + ", instance: " + vm.getName() + ", device id: " + deviceId);
|
||||
System.out.println("Setting data volume device id, vol: " + vol.getName() + ", instance: " + vm.getHostName() + ", device id: " + deviceId);
|
||||
|
||||
vol.setDeviceId(deviceId);
|
||||
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ public class OvsNetworkManagerImpl implements OvsNetworkManager {
|
|||
vm.getAccountId(), vm.getHostId()).getVlan());
|
||||
|
||||
Commands cmds = new Commands(new OvsSetTagAndFlowCommand(
|
||||
vm.getName(), tag, vlans, seqnum.toString(),
|
||||
vm.getHostName(), tag, vlans, seqnum.toString(),
|
||||
vm.getId()));
|
||||
|
||||
try {
|
||||
|
|
@ -504,11 +504,11 @@ public class OvsNetworkManagerImpl implements OvsNetworkManager {
|
|||
CheckAndUpdateDhcpFlow(instance);
|
||||
String vlans = getVlanInPortMapping(accountId, hostId);
|
||||
VmFlowLogVO log = _flowLogDao.findOrNewByVmId(instance.getId(),
|
||||
instance.getName());
|
||||
instance.getHostName());
|
||||
StringBuffer command = new StringBuffer();
|
||||
command.append("vlan");
|
||||
command.append("/");
|
||||
command.append(cmdPair("vmName", instance.getName()));
|
||||
command.append(cmdPair("vmName", instance.getHostName()));
|
||||
command.append("/");
|
||||
command.append(cmdPair("tag", tag));
|
||||
command.append("/");
|
||||
|
|
@ -550,12 +550,12 @@ public class OvsNetworkManagerImpl implements OvsNetworkManager {
|
|||
try {
|
||||
long hostId = router.getHostId();
|
||||
String tag = Long.toString(_vlanMappingDao.findByAccountIdAndHostId(accountId, hostId).getVlan());
|
||||
VmFlowLogVO log = _flowLogDao.findOrNewByVmId(instance.getId(), instance.getName());
|
||||
VmFlowLogVO log = _flowLogDao.findOrNewByVmId(instance.getId(), instance.getHostName());
|
||||
String vlans = getVlanInPortMapping(accountId, hostId);
|
||||
s_logger.debug("ask router " + router.getName() + " on host "
|
||||
s_logger.debug("ask router " + router.getHostName() + " on host "
|
||||
+ hostId + " update vlan map to " + vlans);
|
||||
Commands cmds = new Commands(new OvsSetTagAndFlowCommand(
|
||||
router.getName(), tag, vlans, Long.toString(log.getLogsequence()), instance.getId()));
|
||||
router.getHostName(), tag, vlans, Long.toString(log.getLogsequence()), instance.getId()));
|
||||
_agentMgr.send(router.getHostId(), cmds, _ovsListener);
|
||||
} catch (Exception e) {
|
||||
s_logger.warn("apply flow to router failed", e);
|
||||
|
|
@ -592,7 +592,7 @@ public class OvsNetworkManagerImpl implements OvsNetworkManager {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
log = _flowLogDao.findOrNewByVmId(vmId, vm.getName());
|
||||
log = _flowLogDao.findOrNewByVmId(vmId, vm.getHostName());
|
||||
|
||||
if (log != null && updateSeqno){
|
||||
log.incrLogsequence();
|
||||
|
|
@ -628,7 +628,7 @@ public class OvsNetworkManagerImpl implements OvsNetworkManager {
|
|||
protected Set<Long> getAffectedVms(VMInstanceVO instance, boolean tellRouter) {
|
||||
long accountId = instance.getAccountId();
|
||||
if (!_vlanMappingDirtyDao.isDirty(accountId)) {
|
||||
s_logger.debug("OVSAFFECTED: no VM affected by " + instance.getName());
|
||||
s_logger.debug("OVSAFFECTED: no VM affected by " + instance.getHostName());
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -667,10 +667,10 @@ public class OvsNetworkManagerImpl implements OvsNetworkManager {
|
|||
vo.setAccountId(0);
|
||||
_vlanMappingDirtyDao.markDirty(accountId);
|
||||
String s = String.format("%1$s is the last VM(host:%2$s, accountId:%3$s), remove vlan",
|
||||
instance.getName(), hostId, accountId);
|
||||
instance.getHostName(), hostId, accountId);
|
||||
s_logger.debug("OVSDIRTY:" + s);
|
||||
} else {
|
||||
s_logger.debug(instance.getName()
|
||||
s_logger.debug(instance.getHostName()
|
||||
+ " reduces reference count of (account,host) = ("
|
||||
+ accountId + "," + hostId + ") to " + vo.getRef());
|
||||
}
|
||||
|
|
@ -679,7 +679,7 @@ public class OvsNetworkManagerImpl implements OvsNetworkManager {
|
|||
txn.commit();
|
||||
|
||||
try {
|
||||
Commands cmds = new Commands(new OvsDeleteFlowCommand(instance.getName()));
|
||||
Commands cmds = new Commands(new OvsDeleteFlowCommand(instance.getHostName()));
|
||||
_agentMgr.send(hostId, cmds, _ovsListener);
|
||||
} catch (Exception e) {
|
||||
s_logger.warn("remove flow failed", e);
|
||||
|
|
|
|||
|
|
@ -408,7 +408,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
String encodedPassword = rot13(password);
|
||||
|
||||
Commands cmds = new Commands(OnError.Continue);
|
||||
SavePasswordCommand cmd = new SavePasswordCommand(encodedPassword, nic.getIp4Address(), userVm.getName());
|
||||
SavePasswordCommand cmd = new SavePasswordCommand(encodedPassword, nic.getIp4Address(), userVm.getHostName());
|
||||
cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, router.getPrivateIpAddress());
|
||||
cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
|
||||
cmds.addCommand("password", cmd);
|
||||
|
|
@ -710,7 +710,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
for (DomainRouterVO router : routers) {
|
||||
String privateIP = router.getPrivateIpAddress();
|
||||
if (privateIP != null) {
|
||||
final NetworkUsageCommand usageCmd = new NetworkUsageCommand(privateIP, router.getName());
|
||||
final NetworkUsageCommand usageCmd = new NetworkUsageCommand(privateIP, router.getHostName());
|
||||
final NetworkUsageAnswer answer = (NetworkUsageAnswer) _agentMgr.easySend(router.getHostId(), usageCmd);
|
||||
if (answer != null) {
|
||||
Transaction txn = Transaction.open(Transaction.CLOUD_DB);
|
||||
|
|
@ -1191,7 +1191,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
s_logger.debug("Reapplying vm data (userData and metaData) entries as a part of domR " + router + " start...");
|
||||
createVmDataCommands(router, cmds);
|
||||
// Network usage command to create iptables rules
|
||||
cmds.addCommand("networkUsage", new NetworkUsageCommand(controlNic.getIp4Address(), router.getName(), "create"));
|
||||
cmds.addCommand("networkUsage", new NetworkUsageCommand(controlNic.getIp4Address(), router.getHostName(), "create"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1329,7 +1329,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
}
|
||||
}
|
||||
|
||||
DhcpEntryCommand dhcpCommand = new DhcpEntryCommand(nic.getMacAddress(), nic.getIp4Address(), profile.getVirtualMachine().getName());
|
||||
DhcpEntryCommand dhcpCommand = new DhcpEntryCommand(nic.getMacAddress(), nic.getIp4Address(), profile.getVirtualMachine().getHostName());
|
||||
dhcpCommand.setAccessDetail(NetworkElementCommand.ROUTER_IP, routerControlIpAddress);
|
||||
dhcpCommand.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
|
||||
cmds.addCommand("dhcp", dhcpCommand);
|
||||
|
|
@ -1337,7 +1337,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
// password should be set only on default network element
|
||||
if (password != null && network.isDefault()) {
|
||||
final String encodedPassword = rot13(password);
|
||||
SavePasswordCommand cmd = new SavePasswordCommand(encodedPassword, nic.getIp4Address(), profile.getVirtualMachine().getName());
|
||||
SavePasswordCommand cmd = new SavePasswordCommand(encodedPassword, nic.getIp4Address(), profile.getVirtualMachine().getHostName());
|
||||
cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, router.getPrivateIpAddress());
|
||||
cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
|
||||
cmds.addCommand("password", cmd);
|
||||
|
|
@ -1348,7 +1348,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
|
||||
cmds.addCommand(
|
||||
"vmdata",
|
||||
generateVmDataCommand(router, nic.getIp4Address(), userData, serviceOffering, zoneName, nic.getIp4Address(), profile.getVirtualMachine().getName(), profile.getVirtualMachine()
|
||||
generateVmDataCommand(router, nic.getIp4Address(), userData, serviceOffering, zoneName, nic.getIp4Address(), profile.getVirtualMachine().getHostName(), profile.getVirtualMachine()
|
||||
.getInstanceName(), profile.getId(), sshPublicKey));
|
||||
|
||||
try {
|
||||
|
|
@ -1359,7 +1359,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
|
||||
Answer answer = cmds.getAnswer("dhcp");
|
||||
if (!answer.getResult()) {
|
||||
s_logger.error("Unable to set dhcp entry for " + profile + " on domR: " + router.getName() + " due to " + answer.getDetails());
|
||||
s_logger.error("Unable to set dhcp entry for " + profile + " on domR: " + router.getHostName() + " due to " + answer.getDetails());
|
||||
throw new ResourceUnavailableException("Unable to set dhcp entry for " + profile + " due to " + answer.getDetails(), DataCenter.class, router.getDataCenterId());
|
||||
}
|
||||
|
||||
|
|
@ -1628,7 +1628,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
String serviceOffering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getServiceOfferingId()).getDisplayText();
|
||||
String zoneName = _dcDao.findById(router.getDataCenterId()).getName();
|
||||
cmds.addCommand("vmdata",
|
||||
generateVmDataCommand(router, nic.getIp4Address(), vm.getUserData(), serviceOffering, zoneName, nic.getIp4Address(), vm.getName(), vm.getInstanceName(), vm.getId(), null));
|
||||
generateVmDataCommand(router, nic.getIp4Address(), vm.getUserData(), serviceOffering, zoneName, nic.getIp4Address(), vm.getHostName(), vm.getInstanceName(), vm.getId(), null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1644,7 +1644,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
|
|||
if (nic != null) {
|
||||
s_logger.debug("Creating dhcp entry for vm " + vm + " on domR " + router + ".");
|
||||
|
||||
DhcpEntryCommand dhcpCommand = new DhcpEntryCommand(nic.getMacAddress(), nic.getIp4Address(), vm.getName());
|
||||
DhcpEntryCommand dhcpCommand = new DhcpEntryCommand(nic.getMacAddress(), nic.getIp4Address(), vm.getHostName());
|
||||
dhcpCommand.setAccessDetail(NetworkElementCommand.ROUTER_IP, router.getPrivateIpAddress());
|
||||
dhcpCommand.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName());
|
||||
cmds.addCommand("dhcp", dhcpCommand);
|
||||
|
|
|
|||
|
|
@ -2191,7 +2191,7 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
Object networkId = cmd.getNetworkId();
|
||||
|
||||
SearchBuilder<DomainRouterVO> sb = _routerDao.createSearchBuilder();
|
||||
sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE);
|
||||
sb.and("name", sb.entity().getHostName(), SearchCriteria.Op.LIKE);
|
||||
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
|
||||
sb.and("accountId", sb.entity().getAccountId(), SearchCriteria.Op.IN);
|
||||
sb.and("state", sb.entity().getState(), SearchCriteria.Op.EQ);
|
||||
|
|
@ -2809,12 +2809,12 @@ public class ManagementServerImpl implements ManagementServer {
|
|||
@Override
|
||||
public Pair<String, Integer> getVncPort(VirtualMachine vm) {
|
||||
if (vm.getHostId() == null) {
|
||||
s_logger.warn("VM " + vm.getName() + " does not have host, return -1 for its VNC port");
|
||||
s_logger.warn("VM " + vm.getHostName() + " does not have host, return -1 for its VNC port");
|
||||
return new Pair<String, Integer>(null, -1);
|
||||
}
|
||||
|
||||
if (s_logger.isTraceEnabled()) {
|
||||
s_logger.trace("Trying to retrieve VNC port from agent about VM " + vm.getName());
|
||||
s_logger.trace("Trying to retrieve VNC port from agent about VM " + vm.getHostName());
|
||||
}
|
||||
|
||||
GetVncPortAnswer answer = (GetVncPortAnswer) _agentMgr.easySend(vm.getHostId(), new GetVncPortCommand(vm.getId(), vm.getInstanceName()));
|
||||
|
|
|
|||
|
|
@ -266,12 +266,12 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||
Answer answer = _agentMgr.easySend(storageHost.getId(), setupCmd);
|
||||
if (answer != null && answer.getResult()) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Successfully programmed http auth into " + secStorageVm.getName());
|
||||
s_logger.debug("Successfully programmed http auth into " + secStorageVm.getHostName());
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("failed to program http auth into secondary storage vm : " + secStorageVm.getName());
|
||||
s_logger.debug("failed to program http auth into secondary storage vm : " + secStorageVm.getHostName());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -316,12 +316,12 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||
Answer answer = _agentMgr.easySend(storageHost.getId(), cpc);
|
||||
if (answer != null && answer.getResult()) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Successfully programmed firewall rules into " + secStorageVm.getName());
|
||||
s_logger.debug("Successfully programmed firewall rules into " + secStorageVm.getHostName());
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("failed to program firewall rules into secondary storage vm : " + secStorageVm.getName());
|
||||
s_logger.debug("failed to program firewall rules into secondary storage vm : " + secStorageVm.getHostName());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -447,7 +447,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||
if (s_logger.isTraceEnabled()) {
|
||||
s_logger.trace("Running secondary storage vm pool size : " + runningList.size());
|
||||
for (SecondaryStorageVmVO secStorageVm : runningList) {
|
||||
s_logger.trace("Running secStorageVm instance : " + secStorageVm.getName());
|
||||
s_logger.trace("Running secStorageVm instance : " + secStorageVm.getHostName());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -532,7 +532,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||
}
|
||||
} else {
|
||||
if (s_logger.isInfoEnabled()) {
|
||||
s_logger.info("Secondary storage vm " + secStorageVm.getName() + " is started");
|
||||
s_logger.info("Secondary storage vm " + secStorageVm.getHostName() + " is started");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -728,7 +728,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||
return true;
|
||||
} catch (ResourceUnavailableException e) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Stopping secondary storage vm " + secStorageVm.getName() + " faled : exception " + e.toString());
|
||||
s_logger.debug("Stopping secondary storage vm " + secStorageVm.getHostName() + " faled : exception " + e.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -748,7 +748,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||
|
||||
if (answer != null && answer.getResult()) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug("Successfully reboot secondary storage vm " + secStorageVm.getName());
|
||||
s_logger.debug("Successfully reboot secondary storage vm " + secStorageVm.getHostName());
|
||||
}
|
||||
|
||||
SubscriptionMgr.getInstance().notifySubscribers(ALERT_SUBJECT, this,
|
||||
|
|
@ -756,7 +756,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||
|
||||
return true;
|
||||
} else {
|
||||
String msg = "Rebooting Secondary Storage VM failed - " + secStorageVm.getName();
|
||||
String msg = "Rebooting Secondary Storage VM failed - " + secStorageVm.getHostName();
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(msg);
|
||||
}
|
||||
|
|
@ -821,7 +821,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||
buf.append(" template=domP type=secstorage");
|
||||
buf.append(" host=").append(_mgmt_host);
|
||||
buf.append(" port=").append(_mgmt_port);
|
||||
buf.append(" name=").append(profile.getVirtualMachine().getName());
|
||||
buf.append(" name=").append(profile.getVirtualMachine().getHostName());
|
||||
|
||||
buf.append(" zone=").append(dest.getDataCenter().getId());
|
||||
buf.append(" pod=").append(dest.getPod().getId());
|
||||
|
|
@ -829,7 +829,7 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V
|
|||
if (profile.getVirtualMachine().getRole() == SecondaryStorageVm.Role.templateProcessor)
|
||||
buf.append(" guid=").append(secHost.getGuid());
|
||||
else
|
||||
buf.append(" guid=").append(profile.getVirtualMachine().getName());
|
||||
buf.append(" guid=").append(profile.getVirtualMachine().getHostName());
|
||||
|
||||
String nfsMountPoint = null;
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -1198,7 +1198,7 @@ public class SnapshotManagerImpl implements SnapshotManager, SnapshotService, Ma
|
|||
VMInstanceVO vmInstance = _vmDao.findById(volume.getInstanceId());
|
||||
String vmDisplayName = "detached";
|
||||
if (vmInstance != null) {
|
||||
vmDisplayName = vmInstance.getName();
|
||||
vmDisplayName = vmInstance.getHostName();
|
||||
}
|
||||
String snapshotName = vmDisplayName + "_" + volume.getName() + "_" + timeString;
|
||||
|
||||
|
|
|
|||
|
|
@ -934,7 +934,7 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
|
|||
s_logger.error("Unable to destroy vm: " + vm.getId());
|
||||
accountCleanupNeeded = true;
|
||||
}
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_DESTROY, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getName(), vm.getServiceOfferingId(),
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_DESTROY, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getHostName(), vm.getServiceOfferingId(),
|
||||
vm.getTemplateId(), vm.getHypervisorType().toString());
|
||||
_usageEventDao.persist(usageEvent);
|
||||
}
|
||||
|
|
@ -1046,11 +1046,11 @@ public class AccountManagerImpl implements AccountManager, AccountService, Manag
|
|||
try {
|
||||
success = (success && _itMgr.advanceStop(vm, true, getSystemUser(), getSystemAccount()));
|
||||
} catch (OperationTimedoutException ote) {
|
||||
s_logger.warn("Operation for stopping vm timed out, unable to stop vm " + vm.getName(), ote);
|
||||
s_logger.warn("Operation for stopping vm timed out, unable to stop vm " + vm.getHostName(), ote);
|
||||
success = false;
|
||||
}
|
||||
} catch (AgentUnavailableException aue) {
|
||||
s_logger.warn("Agent running on host " + vm.getHostId() + " is unavailable, unable to stop vm " + vm.getName(), aue);
|
||||
s_logger.warn("Agent running on host " + vm.getHostId() + " is unavailable, unable to stop vm " + vm.getHostName(), aue);
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -540,7 +540,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
VolumeVO rootVolumeOfVm = null;
|
||||
List<VolumeVO> rootVolumesOfVm = _volsDao.findByInstanceAndType(vmId, Volume.Type.ROOT);
|
||||
if (rootVolumesOfVm.size() != 1) {
|
||||
throw new CloudRuntimeException("The VM " + vm.getName() + " has more than one ROOT volume and is in an invalid state. Please contact Cloud Support.");
|
||||
throw new CloudRuntimeException("The VM " + vm.getHostName() + " has more than one ROOT volume and is in an invalid state. Please contact Cloud Support.");
|
||||
} else {
|
||||
rootVolumeOfVm = rootVolumesOfVm.get(0);
|
||||
}
|
||||
|
|
@ -559,7 +559,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
volume = _storageMgr.createVolume(volume, vm, rootDiskTmplt, dcVO, pod, rootDiskPool.getClusterId(), svo, diskVO, new ArrayList<StoragePoolVO>(), volume.getSize(), rootDiskHyperType);
|
||||
|
||||
if (volume == null) {
|
||||
throw new CloudRuntimeException("Failed to create volume when attaching it to VM: " + vm.getName());
|
||||
throw new CloudRuntimeException("Failed to create volume when attaching it to VM: " + vm.getHostName());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -575,7 +575,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
}
|
||||
for (VolumeVO vol : vols) {
|
||||
if (vol.getDeviceId().equals(deviceId)) {
|
||||
throw new RuntimeException("deviceId " + deviceId + " is used by VM " + vm.getName());
|
||||
throw new RuntimeException("deviceId " + deviceId + " is used by VM " + vm.getHostName());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -641,7 +641,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
_asyncMgr.updateAsyncJobStatus(job.getId(), BaseCmd.PROGRESS_INSTANCE_CREATED, volumeId);
|
||||
}
|
||||
|
||||
String errorMsg = "Failed to attach volume: " + volume.getName() + " to VM: " + vm.getName();
|
||||
String errorMsg = "Failed to attach volume: " + volume.getName() + " to VM: " + vm.getHostName();
|
||||
boolean sendCommand = (vm.getState() == State.Running);
|
||||
AttachVolumeAnswer answer = null;
|
||||
Long hostId = vm.getHostId();
|
||||
|
|
@ -767,7 +767,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
_asyncMgr.updateAsyncJobStatus(job.getId(), BaseCmd.PROGRESS_INSTANCE_CREATED, volumeId);
|
||||
}
|
||||
|
||||
String errorMsg = "Failed to detach volume: " + volume.getName() + " from VM: " + vm.getName();
|
||||
String errorMsg = "Failed to detach volume: " + volume.getName() + " from VM: " + vm.getHostName();
|
||||
boolean sendCommand = (vm.getState() == State.Running);
|
||||
Answer answer = null;
|
||||
|
||||
|
|
@ -1094,7 +1094,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
|
||||
_accountMgr.incrementResourceCount(account.getId(), ResourceType.volume, new Long(volumes.size()));
|
||||
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_CREATE, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getName(), vm.getServiceOfferingId(), vm.getTemplateId(), vm
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_CREATE, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getHostName(), vm.getServiceOfferingId(), vm.getTemplateId(), vm
|
||||
.getHypervisorType().toString());
|
||||
_usageEventDao.persist(usageEvent);
|
||||
txn.commit();
|
||||
|
|
@ -1581,7 +1581,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
s_logger.warn("Unable to delete volume:" + volume.getId() + " for vm:" + vmId + " whilst transitioning to error state");
|
||||
}
|
||||
}
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_DESTROY, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getName());
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_DESTROY, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getHostName());
|
||||
_usageEventDao.persist(usageEvent);
|
||||
}
|
||||
}
|
||||
|
|
@ -2352,7 +2352,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
s_logger.debug("Successfully allocated DB entry for " + vm);
|
||||
}
|
||||
UserContext.current().setEventDetails("Vm Id: " + vm.getId());
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_CREATE, accountId, zone.getId(), vm.getId(), vm.getName(), offering.getId(), template.getId(), hypervisorType.toString());
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_CREATE, accountId, zone.getId(), vm.getId(), vm.getHostName(), offering.getId(), template.getId(), hypervisorType.toString());
|
||||
_usageEventDao.persist(usageEvent);
|
||||
|
||||
_accountMgr.incrementResourceCount(accountId, ResourceType.user_vm);
|
||||
|
|
@ -2521,7 +2521,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
@Override
|
||||
public boolean finalizeStart(VirtualMachineProfile<UserVmVO> profile, long hostId, Commands cmds, ReservationContext context) {
|
||||
UserVmVO vm = profile.getVirtualMachine();
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_START, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getName(), vm.getServiceOfferingId(), vm.getTemplateId(), vm
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_START, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getHostName(), vm.getServiceOfferingId(), vm.getTemplateId(), vm
|
||||
.getHypervisorType().toString());
|
||||
_usageEventDao.persist(usageEvent);
|
||||
|
||||
|
|
@ -2529,7 +2529,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
for (NicVO nic : nics) {
|
||||
NetworkVO network = _networkDao.findById(nic.getNetworkId());
|
||||
long isDefault = (nic.isDefaultNic()) ? 1 : 0;
|
||||
usageEvent = new UsageEventVO(EventTypes.EVENT_NETWORK_OFFERING_ASSIGN, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getName(), network.getNetworkOfferingId(), null, isDefault);
|
||||
usageEvent = new UsageEventVO(EventTypes.EVENT_NETWORK_OFFERING_ASSIGN, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getHostName(), network.getNetworkOfferingId(), null, isDefault);
|
||||
_usageEventDao.persist(usageEvent);
|
||||
}
|
||||
|
||||
|
|
@ -2593,7 +2593,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
@Override
|
||||
public void finalizeStop(VirtualMachineProfile<UserVmVO> profile, StopAnswer answer) {
|
||||
VMInstanceVO vm = profile.getVirtualMachine();
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_STOP, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getName());
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_STOP, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getHostName());
|
||||
_usageEventDao.persist(usageEvent);
|
||||
|
||||
List<NicVO> nics = _nicDao.listByVmId(vm.getId());
|
||||
|
|
@ -2661,7 +2661,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
_usageEventDao.persist(usageEvent);
|
||||
}
|
||||
}
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_DESTROY, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getName());
|
||||
UsageEventVO usageEvent = new UsageEventVO(EventTypes.EVENT_VM_DESTROY, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getHostName());
|
||||
_usageEventDao.persist(usageEvent);
|
||||
|
||||
if (vmState != State.Error) {
|
||||
|
|
@ -2794,7 +2794,7 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
|||
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
|
||||
sb.and("accountIdEQ", sb.entity().getAccountId(), SearchCriteria.Op.EQ);
|
||||
sb.and("accountIdIN", sb.entity().getAccountId(), SearchCriteria.Op.IN);
|
||||
sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE);
|
||||
sb.and("name", sb.entity().getHostName(), SearchCriteria.Op.LIKE);
|
||||
sb.and("stateEQ", sb.entity().getState(), SearchCriteria.Op.EQ);
|
||||
sb.and("stateNEQ", sb.entity().getState(), SearchCriteria.Op.NEQ);
|
||||
sb.and("stateNIN", sb.entity().getState(), SearchCriteria.Op.NIN);
|
||||
|
|
|
|||
|
|
@ -1113,7 +1113,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||
if (!migrated) {
|
||||
s_logger.info("Migration was unsuccessful. Cleaning up: " + vm);
|
||||
|
||||
_alertMgr.sendAlert(alertType, fromHost.getDataCenterId(), fromHost.getPodId(), "Unable to migrate vm " + vm.getName() + " from host " + fromHost.getName() + " in zone "
|
||||
_alertMgr.sendAlert(alertType, fromHost.getDataCenterId(), fromHost.getPodId(), "Unable to migrate vm " + vm.getHostName() + " from host " + fromHost.getName() + " in zone "
|
||||
+ dest.getDataCenter().getName() + " and pod " + dest.getPod().getName(), "Migrate Command failed. Please check logs.");
|
||||
try {
|
||||
_agentMgr.send(dstHostId, new Commands(cleanup(vm.getInstanceName())), null);
|
||||
|
|
@ -1280,7 +1280,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||
try {
|
||||
|
||||
Commands cmds = new Commands(OnError.Revert);
|
||||
cmds.addCommand(new RebootCommand(vm.getName()));
|
||||
cmds.addCommand(new RebootCommand(vm.getHostName()));
|
||||
_agentMgr.send(host.getId(), cmds);
|
||||
|
||||
Answer rebootAnswer = cmds.getAnswer(RebootAnswer.class);
|
||||
|
|
@ -1375,7 +1375,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||
State agentState = info.state;
|
||||
final String agentName = info.name;
|
||||
final State serverState = vm.getState();
|
||||
final String serverName = vm.getName();
|
||||
final String serverName = vm.getHostName();
|
||||
|
||||
VirtualMachineGuru<VMInstanceVO> vmGuru = getVmGuru(vm);
|
||||
|
||||
|
|
@ -1400,8 +1400,8 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||
HostVO hostVO = _hostDao.findById(vm.getHostId());
|
||||
|
||||
String hostDesc = "name: " + hostVO.getName() + " (id:" + hostVO.getId() + "), availability zone: " + dcVO.getName() + ", pod: " + podVO.getName();
|
||||
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodId(), "VM (name: " + vm.getName() + ", id: " + vm.getId() + ") stopped on host " + hostDesc + " due to storage failure",
|
||||
"Virtual Machine " + vm.getName() + " (id: " + vm.getId() + ") running on host [" + vm.getHostId() + "] stopped due to storage failure.");
|
||||
_alertMgr.sendAlert(alertType, vm.getDataCenterId(), vm.getPodId(), "VM (name: " + vm.getHostName() + ", id: " + vm.getId() + ") stopped on host " + hostDesc + " due to storage failure",
|
||||
"Virtual Machine " + vm.getHostName() + " (id: " + vm.getId() + ") running on host [" + vm.getHostId() + "] stopped due to storage failure.");
|
||||
}
|
||||
|
||||
// if (serverState == State.Migrating) {
|
||||
|
|
@ -1453,7 +1453,7 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene
|
|||
_haMgr.scheduleStop(vm, vm.getHostId(), WorkType.ForceStop);
|
||||
s_logger.debug("Scheduling a check stop for VM in stopping mode: " + vm);
|
||||
} else if (serverState == State.Starting) {
|
||||
s_logger.debug("Ignoring VM in starting mode: " + vm.getName());
|
||||
s_logger.debug("Ignoring VM in starting mode: " + vm.getHostName());
|
||||
_haMgr.scheduleRestart(vm, false);
|
||||
}
|
||||
command = cleanup(agentName);
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ public class VirtualMachineProfileImpl<T extends VMInstanceVO> implements Virtua
|
|||
|
||||
@Override
|
||||
public String getHostName() {
|
||||
return _vm.getName();
|
||||
return _vm.getHostName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public class VMInstanceDaoImpl extends GenericDaoBase<VMInstanceVO, Long> implem
|
|||
ZoneTemplateNonExpungedSearch.done();
|
||||
|
||||
NameLikeSearch = createSearchBuilder();
|
||||
NameLikeSearch.and("name", NameLikeSearch.entity().getName(), Op.LIKE);
|
||||
NameLikeSearch.and("name", NameLikeSearch.entity().getHostName(), Op.LIKE);
|
||||
NameLikeSearch.done();
|
||||
|
||||
StateChangeSearch = createSearchBuilder();
|
||||
|
|
|
|||
|
|
@ -921,7 +921,7 @@ public class NetUtils {
|
|||
if (hostName.length() > 63 || hostName.length() < 1) {
|
||||
s_logger.warn("Domain name label must be between 1 and 63 characters long");
|
||||
return false;
|
||||
} else if (!hostName.toLowerCase().matches("[a-zA-z0-9-]*")) {
|
||||
} else if (!hostName.toLowerCase().matches("[a-z0-9-]*")) {
|
||||
s_logger.warn("Domain name label may contain only the ASCII letters 'a' through 'z' (in a case-insensitive manner)");
|
||||
return false;
|
||||
} else if (hostName.startsWith("-") || hostName.endsWith("-")) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue