@@ -299,6 +299,15 @@ public DeployDestination planDeployment(VirtualMachineProfile vmProfile,
299299 + ", pod: " + host .getPodId () + ", cluster: " + host .getClusterId ());
300300 }
301301
302+ Pod pod = _podDao .findById (host .getPodId ());
303+ Cluster cluster = _clusterDao .findById (host .getClusterId ());
304+
305+ if (vm .getHypervisorType () == HypervisorType .BareMetal ) {
306+ DeployDestination dest = new DeployDestination (dc , pod , cluster , host , new HashMap <Volume , StoragePool >());
307+ s_logger .debug ("Returning Deployment Destination: " + dest );
308+ return dest ;
309+ }
310+
302311 // search for storage under the zone, pod, cluster of the host.
303312 DataCenterDeployment lastPlan = new DataCenterDeployment (host .getDataCenterId (), host .getPodId (),
304313 host .getClusterId (), hostIdSpecified , plan .getPoolId (), null , plan .getReservationContext ());
@@ -315,8 +324,6 @@ public DeployDestination planDeployment(VirtualMachineProfile vmProfile,
315324 Pair <Host , Map <Volume , StoragePool >> potentialResources = findPotentialDeploymentResources (
316325 suitableHosts , suitableVolumeStoragePools , avoids , getPlannerUsage (planner ,vmProfile , plan ,avoids ), readyAndReusedVolumes );
317326 if (potentialResources != null ) {
318- Pod pod = _podDao .findById (host .getPodId ());
319- Cluster cluster = _clusterDao .findById (host .getClusterId ());
320327 Map <Volume , StoragePool > storageVolMap = potentialResources .second ();
321328 // remove the reused vol<->pool from destination, since
322329 // we don't have to prepare this volume.
@@ -362,6 +369,17 @@ public DeployDestination planDeployment(VirtualMachineProfile vmProfile,
362369 + ", pod: " + host .getPodId () + ", cluster: " + host .getClusterId ());
363370 // search for storage under the zone, pod, cluster of
364371 // the last host.
372+
373+
374+ Pod pod = _podDao .findById (host .getPodId ());
375+ Cluster cluster = _clusterDao .findById (host .getClusterId ());
376+
377+ if (vm .getHypervisorType () == HypervisorType .BareMetal ) {
378+ DeployDestination dest = new DeployDestination (dc , pod , cluster , host , new HashMap <Volume , StoragePool >());
379+ s_logger .debug ("Returning Deployment Destination: " + dest );
380+ return dest ;
381+ }
382+
365383 DataCenterDeployment lastPlan = new DataCenterDeployment (host .getDataCenterId (),
366384 host .getPodId (), host .getClusterId (), host .getId (), plan .getPoolId (), null );
367385 Pair <Map <Volume , List <StoragePool >>, List <Volume >> result = findSuitablePoolsForVolumes (
@@ -376,8 +394,6 @@ public DeployDestination planDeployment(VirtualMachineProfile vmProfile,
376394 Pair <Host , Map <Volume , StoragePool >> potentialResources = findPotentialDeploymentResources (
377395 suitableHosts , suitableVolumeStoragePools , avoids , getPlannerUsage (planner ,vmProfile , plan ,avoids ), readyAndReusedVolumes );
378396 if (potentialResources != null ) {
379- Pod pod = _podDao .findById (host .getPodId ());
380- Cluster cluster = _clusterDao .findById (host .getClusterId ());
381397 Map <Volume , StoragePool > storageVolMap = potentialResources .second ();
382398 // remove the reused vol<->pool from
383399 // destination, since we don't have to prepare
0 commit comments