File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
server/src/main/java/com/cloud/hypervisor Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 2323
2424import javax .inject .Inject ;
2525
26+ import com .cloud .cpu .CPU ;
2627import com .cloud .dc .DataCenter ;
2728import com .cloud .dc .dao .DataCenterDao ;
2829import com .cloud .domain .Domain ;
@@ -307,10 +308,15 @@ protected VirtualMachineTO toVirtualMachineTO(VirtualMachineProfile vmProfile) {
307308 to .setNics (nics );
308309 to .setDisks (vmProfile .getDisks ().toArray (new DiskTO [vmProfile .getDisks ().size ()]));
309310
310- if (vmProfile .getTemplate ().getBits () == 32 ) {
311- to .setArch ("i686" );
311+ CPU .CPUArch templateArch = vmProfile .getTemplate ().getArch ();
312+ if (templateArch != null ) {
313+ to .setArch (templateArch .getType ());
312314 } else {
313- to .setArch ("x86_64" );
315+ if (vmProfile .getTemplate ().getBits () == 32 ) {
316+ to .setArch ("i686" );
317+ } else {
318+ to .setArch ("x86_64" );
319+ }
314320 }
315321
316322 Map <String , String > detailsInVm = _userVmDetailsDao .listDetailsKeyPairs (vm .getId ());
You can’t perform that action at this time.
0 commit comments