@@ -2048,8 +2048,8 @@ protected StartAnswer execute(StartCommand cmd) {
20482048 continue ;
20492049
20502050 VirtualMachineDiskInfo matchingExistingDisk = getMatchingExistingDisk (diskInfoBuilder , vol , hyperHost , context );
2051- controllerKey = getDiskController ( matchingExistingDisk , vol , vmSpec , ideControllerKey , scsiControllerKey );
2052- String diskController = getDiskController (vmMo , matchingExistingDisk , vol , new Pair <String , String >(rootDiskController , dataDiskController ));
2051+
2052+ String diskController = getDiskController (vol , new Pair <String , String >(rootDiskController , dataDiskController ));
20532053
20542054 if (DiskControllerType .getType (diskController ) == DiskControllerType .osdefault ) {
20552055 diskController = vmMo .getRecommendedDiskController (null );
@@ -3003,26 +3003,7 @@ private int getDiskController(VirtualMachineDiskInfo matchingExistingDisk, DiskT
30033003 return controllerKey ;
30043004 }
30053005
3006- private String getDiskController (VirtualMachineMO vmMo , VirtualMachineDiskInfo matchingExistingDisk , DiskTO vol , Pair <String , String > controllerInfo ) throws Exception {
3007- int controllerKey ;
3008- DiskControllerType controllerType = DiskControllerType .none ;
3009- if (matchingExistingDisk != null ) {
3010- String currentBusName = matchingExistingDisk .getDiskDeviceBusName ();
3011- if (currentBusName != null ) {
3012- s_logger .info ("Chose disk controller based on existing information: " + currentBusName );
3013- if (currentBusName .startsWith ("ide" )) {
3014- controllerType = DiskControllerType .ide ;
3015- } else if (currentBusName .startsWith ("scsi" )) {
3016- controllerType = DiskControllerType .scsi ;
3017- }
3018- }
3019- if (controllerType == DiskControllerType .scsi || controllerType == DiskControllerType .none ) {
3020- Ternary <Integer , Integer , DiskControllerType > vmScsiControllerInfo = vmMo .getScsiControllerInfo ();
3021- controllerType = vmScsiControllerInfo .third ();
3022- }
3023- return controllerType .toString ();
3024- }
3025-
3006+ private String getDiskController (DiskTO vol , Pair <String , String > controllerInfo ) {
30263007 if (vol .getType () == Volume .Type .ROOT ) {
30273008 s_logger .info ("Chose disk controller for vol " + vol .getType () + " -> " + controllerInfo .first ()
30283009 + ", based on root disk controller settings at global configuration setting." );
0 commit comments