@@ -2271,39 +2271,7 @@ protected StartAnswer execute(StartCommand cmd) {
22712271 // Setup ISO device
22722272 //
22732273
2274- // prepare systemvm patch ISO
2275- if (vmSpec .getType () != VirtualMachine .Type .User ) {
2276- // attach ISO (for patching of system VM)
2277- Pair <String , Long > secStoreUrlAndId = mgr .getSecondaryStorageStoreUrlAndId (Long .parseLong (_dcId ));
2278- String secStoreUrl = secStoreUrlAndId .first ();
2279- if (secStoreUrl == null ) {
2280- String msg = String .format ("NFS secondary or cache storage of dc %s either doesn't have enough capacity (has reached %d%% usage threshold) or not ready yet, or non-NFS secondary storage is used" ,
2281- _dcId , Math .round (CapacityManager .SecondaryStorageCapacityThreshold .value () * 100 ));
2282- throw new Exception (msg );
2283- }
2284-
2285- ManagedObjectReference morSecDs = prepareSecondaryDatastoreOnHost (secStoreUrl );
2286- if (morSecDs == null ) {
2287- String msg = "Failed to prepare secondary storage on host, NFS secondary or cache store url: " + secStoreUrl + " in dc " + _dcId ;
2288- throw new Exception (msg );
2289- }
2290- DatastoreMO secDsMo = new DatastoreMO (hyperHost .getContext (), morSecDs );
2291-
2292- deviceConfigSpecArray [i ] = new VirtualDeviceConfigSpec ();
2293- Pair <VirtualDevice , Boolean > isoInfo = VmwareHelper .prepareIsoDevice (vmMo ,
2294- null , secDsMo .getMor (), true , true , ideUnitNumber ++, i + 1 );
2295- deviceConfigSpecArray [i ].setDevice (isoInfo .first ());
2296- if (isoInfo .second ()) {
2297- if (logger .isDebugEnabled ())
2298- logger .debug ("Prepare ISO volume at new device " + _gson .toJson (isoInfo .first ()));
2299- deviceConfigSpecArray [i ].setOperation (VirtualDeviceConfigSpecOperation .ADD );
2300- } else {
2301- if (logger .isDebugEnabled ())
2302- logger .debug ("Prepare ISO volume at existing device " + _gson .toJson (isoInfo .first ()));
2303- deviceConfigSpecArray [i ].setOperation (VirtualDeviceConfigSpecOperation .EDIT );
2304- }
2305- i ++;
2306- } else if (!deployAsIs ) {
2274+ if (VirtualMachine .Type .User .equals (vmSpec .getType ()) && !deployAsIs ) {
23072275 // Note: we will always plug a CDROM device
23082276 if (volIso != null ) {
23092277 for (DiskTO vol : disks ) {
0 commit comments