private void SetOptionalFeatureParameters(SetupSettings settings) { this.EnableCircularTraceSession = settings.EnableCircularTraceSession; DeploymentSpecification.SetEnableCircularTraceSession(this.EnableCircularTraceSession); // Initialize the properties used to reflect state of preview features that need to lightup at runtime this.EnableUnsupportedPreviewFeatures = settings.EnableUnsupportedPreviewFeatures; this.IsSFVolumeDiskServiceEnabled = settings.IsSFVolumeDiskServiceEnabled; }
public void Initialize() { DeploymentOperations operation = Operation; if (operation == DeploymentOperations.Create || operation == DeploymentOperations.Update || operation == DeploymentOperations.Configure) { if (this.ClusterManifestLocation == null || !File.Exists(this.ClusterManifestLocation)) { throw new InvalidDeploymentParameterException(StringResources.Error_FabricDeployer_ClusterManifestNotFound_Formatted); } } switch (operation) { case DeploymentOperations.Configure: { ClusterManifestType manifest = XmlHelper.ReadXml <ClusterManifestType>(this.ClusterManifestLocation, SchemaLocation.GetWindowsFabricSchemaLocation()); SetupSettings settings = new SetupSettings(manifest); this.FabricDataRoot = settings.FabricDataRoot == null ? this.FabricDataRoot : settings.FabricDataRoot; this.FabricLogRoot = settings.FabricLogRoot == null ? this.FabricLogRoot : settings.FabricLogRoot; bool isDataRootProvided = this.FabricDataRoot != null; ResolveDataRoot(isDataRootProvided); DeploymentSpecification.SetDataRoot(this.FabricDataRoot); ResolveLogRoot(isDataRootProvided); DeploymentSpecification.SetLogRoot(this.FabricLogRoot); this.EnableCircularTraceSession = settings.EnableCircularTraceSession; DeploymentSpecification.SetEnableCircularTraceSession(this.EnableCircularTraceSession); // Initialize the properties used to reflect state of preview features that need to lightup at runtime this.EnableUnsupportedPreviewFeatures = settings.EnableUnsupportedPreviewFeatures; this.IsSFVolumeDiskServiceEnabled = settings.IsSFVolumeDiskServiceEnabled; } break; case DeploymentOperations.RemoveNodeConfig: // for RemoveNodeConfig the user does not pass the data root in, so it has to be determined this.FabricDataRoot = FabricEnvironment.GetDataRoot(this.MachineName); this.FabricLogRoot = FabricEnvironment.GetLogRoot(this.MachineName); DeploymentSpecification.SetDataRoot(this.FabricDataRoot); DeploymentSpecification.SetLogRoot(this.FabricLogRoot); break; case DeploymentOperations.Create: case DeploymentOperations.None: case DeploymentOperations.Remove: case DeploymentOperations.Rollback: case DeploymentOperations.Update: case DeploymentOperations.UpdateNodeState: case DeploymentOperations.UpdateInstanceId: SetCommonRoots(); break; case DeploymentOperations.ValidateClusterManifest: SetCommonRoots(Directory.GetCurrentDirectory()); break; case DeploymentOperations.Validate: if (this.OldClusterManifestLocation != null && File.Exists(this.OldClusterManifestLocation) && this.FabricDataRoot == null) { SetCommonRoots(Path.GetDirectoryName(this.OldClusterManifestLocation)); } else { SetCommonRoots(); } break; case DeploymentOperations.DockerDnsSetup: case DeploymentOperations.DockerDnsCleanup: case DeploymentOperations.ContainerNetworkSetup: case DeploymentOperations.ContainerNetworkCleanup: break; default: throw new InvalidOperationException(String.Format("The operation {0} has no explicit deployment criteria.", operation.ToString())); } if (this.InfrastructureManifestLocation == null && this.NodeName != null) { this.InfrastructureManifestLocation = this.DeploymentSpecification.GetInfrastructureManfiestFile(this.NodeName); } if (operation == DeploymentOperations.UpdateNodeState || operation == DeploymentOperations.Remove || operation == DeploymentOperations.UpdateInstanceId || (operation == DeploymentOperations.RemoveNodeConfig && !string.IsNullOrEmpty(this.FabricDataRoot) && Directory.Exists(this.FabricDataRoot))) { this.ClusterManifestLocation = Helpers.GetCurrentClusterManifestPath(this.FabricDataRoot); this.InfrastructureManifestLocation = Helpers.GetInfrastructureManifestPath(this.FabricDataRoot); } if (!string.IsNullOrEmpty(this.ClusterManifestLocation)) { ClusterManifestType manifest = XmlHelper.ReadXml <ClusterManifestType>(this.ClusterManifestLocation, SchemaLocation.GetWindowsFabricSchemaLocation()); SetupSettings settings = new SetupSettings(manifest); this.SkipFirewallConfiguration = settings.SkipFirewallConfiguration; this.ContainerDnsSetup = settings.ContainerDnsSetup; this.ContainerNetworkSetup = settings.ContainerNetworkSetup; this.ContainerNetworkName = settings.ContainerNetworkName; #if !DotNetCoreClrLinux this.SkipContainerNetworkResetOnReboot = settings.SkipContainerNetworkResetOnReboot; #endif } else { this.SkipFirewallConfiguration = false; } Validate(); }