@Override public void precheck() throws Exception { super.precheck(); createBlockVolumeHelper.precheck(); long capacityInBytes = createBlockVolumeHelper.getSizeInGb().longValue() * 1024 * 1024 * 1024; mountBlockVolumeHelpers = MountBlockVolumeHelper.createHelpers(windowsSystems, capacityInBytes); for (MountBlockVolumeHelper mountBlockVolumeHelper : mountBlockVolumeHelpers) { mountBlockVolumeHelper.precheck(); } if (isClustered()) { mountBlockVolumeHelpers.get(0).verifyClusterHosts(hosts); } }
@Override public void execute() throws Exception { BlockObjectRestRep volume = createBlockVolumeHelper.createAndExportVolumes().get(0); acquireHostAndClusterLock(); // Only perform mounting/formatting on ONE host DiskDrive diskDrive = mountBlockVolumeHelpers.get(0).mountVolume(volume); if (isClustered()) { for (int i = 1; i < mountBlockVolumeHelpers.size(); i++) { mountBlockVolumeHelpers.get(i).rescanDisks(); } mountBlockVolumeHelpers.get(0).addDisksToCluster(Collections.singleton(diskDrive)); } // Only perform formatting on ONE machine // for (MountBlockVolumeHelper mountBlockVolumeHelper : mountBlockVolumeHelper) { // mountBlockVolumeHelper.doFormat = false; // } // mountBlockVolumeHelper.get(0).doFormat = true; // // // for (MountBlockVolumeHelper mountBlockVolumeHelper : mountBlockVolumeHelper) { // mountBlockVolumeHelper.mountVolumes(volumes, false); // } }