add vncPassword on hypervisor back

This commit is contained in:
Kelven Yang 2011-03-23 16:17:08 -07:00
parent a8a5d18d91
commit 1c9196f9af
2 changed files with 13 additions and 2 deletions

View File

@ -39,12 +39,13 @@ public class VirtualMachineTO {
String[] bootupScripts;
boolean rebootOnCrash;
boolean enableHA;
String vncPassword;
Map<String, String> params;
VolumeTO[] disks;
NicTO[] nics;
public VirtualMachineTO(long id, String instanceName, VirtualMachine.Type type, int cpus, Integer speed, long minRam, long maxRam, BootloaderType bootloader, String os, boolean enableHA) {
public VirtualMachineTO(long id, String instanceName, VirtualMachine.Type type, int cpus, Integer speed, long minRam, long maxRam, BootloaderType bootloader, String os, boolean enableHA, String vncPassword) {
this.id = id;
this.name = instanceName;
this.type = type;
@ -55,6 +56,7 @@ public class VirtualMachineTO {
this.bootloader = bootloader;
this.os = os;
this.enableHA = enableHA;
this.vncPassword = vncPassword;
}
protected VirtualMachineTO() {
@ -176,4 +178,12 @@ public class VirtualMachineTO {
public void setNics(NicTO[] nics) {
this.nics = nics;
}
public String getVncPassword() {
return this.vncPassword;
}
public void setVncPassword(String vncPassword) {
this.vncPassword = vncPassword;
}
}

View File

@ -59,7 +59,8 @@ public abstract class HypervisorGuruBase extends AdapterBase implements Hypervis
ServiceOffering offering = vmProfile.getServiceOffering();
VirtualMachine vm = vmProfile.getVirtualMachine();
VirtualMachineTO to = new VirtualMachineTO(vm.getId(), vm.getInstanceName(), vm.getType(), offering.getCpu(), offering.getSpeed(), offering.getRamSize() * 1024l * 1024l, offering.getRamSize() * 1024l * 1024l, null, null, vm.isHaEnabled());
VirtualMachineTO to = new VirtualMachineTO(vm.getId(), vm.getInstanceName(), vm.getType(), offering.getCpu(), offering.getSpeed(),
offering.getRamSize() * 1024l * 1024l, offering.getRamSize() * 1024l * 1024l, null, null, vm.isHaEnabled(), vm.getVncPassword());
to.setBootArgs(vmProfile.getBootArgs());
List<NicProfile> nicProfiles = vmProfile.getNics();