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 23
23
24
24
import javax .inject .Inject ;
25
25
26
+ import com .cloud .cpu .CPU ;
26
27
import com .cloud .dc .DataCenter ;
27
28
import com .cloud .dc .dao .DataCenterDao ;
28
29
import com .cloud .domain .Domain ;
@@ -307,10 +308,15 @@ protected VirtualMachineTO toVirtualMachineTO(VirtualMachineProfile vmProfile) {
307
308
to .setNics (nics );
308
309
to .setDisks (vmProfile .getDisks ().toArray (new DiskTO [vmProfile .getDisks ().size ()]));
309
310
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 ());
312
314
} else {
313
- to .setArch ("x86_64" );
315
+ if (vmProfile .getTemplate ().getBits () == 32 ) {
316
+ to .setArch (CPU .CPUArch .x86 .getType ());
317
+ } else {
318
+ to .setArch (CPU .CPUArch .amd64 .getType ());
319
+ }
314
320
}
315
321
316
322
Map <String , String > detailsInVm = _userVmDetailsDao .listDetailsKeyPairs (vm .getId ());
You can’t perform that action at this time.
0 commit comments