mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 01:32:18 +02:00
server: set VirtualMachineTO arch from template if present (#11530)
* server: set VirtualMachineTO arch from template if present Fixes #11529 Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> * refactor Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com> --------- Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
a18b5514e6
commit
98b9af2904
@ -23,6 +23,7 @@ import java.util.UUID;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import com.cloud.cpu.CPU;
|
||||
import com.cloud.dc.DataCenter;
|
||||
import com.cloud.dc.dao.DataCenterDao;
|
||||
import com.cloud.domain.Domain;
|
||||
@ -307,10 +308,15 @@ public abstract class HypervisorGuruBase extends AdapterBase implements Hypervis
|
||||
to.setNics(nics);
|
||||
to.setDisks(vmProfile.getDisks().toArray(new DiskTO[vmProfile.getDisks().size()]));
|
||||
|
||||
if (vmProfile.getTemplate().getBits() == 32) {
|
||||
to.setArch("i686");
|
||||
CPU.CPUArch templateArch = vmProfile.getTemplate().getArch();
|
||||
if (templateArch != null) {
|
||||
to.setArch(templateArch.getType());
|
||||
} else {
|
||||
to.setArch("x86_64");
|
||||
if (vmProfile.getTemplate().getBits() == 32) {
|
||||
to.setArch(CPU.CPUArch.x86.getType());
|
||||
} else {
|
||||
to.setArch(CPU.CPUArch.amd64.getType());
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, String> detailsInVm = _userVmDetailsDao.listDetailsKeyPairs(vm.getId());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user