/// <summary> /// Creates a deployment payload for a predefined template /// </summary> /// <returns>A string xml representation</returns> protected override string CreatePayload() { var deployment = Deployment.GetAdHocWindowsTemplateDeployment(Properties); var document = new XDocument(deployment.GetXmlTree()); return(document.ToStringFullXmlDeclarationWithReplace()); }
/// <summary> /// Creates a deployment payload for a predefined template /// </summary> /// <returns>A string xml representation</returns> protected override string CreateXmlPayload() { Deployment deployment = null; switch (VirtualMachineType) { case VirtualMachineTemplates.SqlServer2012: deployment = Deployment.GetDefaultSqlServer2012Deployment(CloudServiceName, VhdStorageAccount); break; } var document = new XDocument(deployment.GetXmlTree()); return(document.ToStringFullXmlDeclarationWithReplace()); }
/// <summary> /// Used to create a deployment and add any persistent vm role to the deployment /// </summary> /// <param name="properties"></param> /// <param name="roles">The PersistentVMRole</param> /// <returns>The Deployment that is being used</returns> private static Deployment AddPersistentVMRole(VirtualMachineProperties properties, IEnumerable<PersistentVMRole> roles) { var namer = new RandomAccountName(); var deployment = new Deployment { // use the first deployment property if it's not the same then fluent doesn't supporting deployment splitting at this level! Name = properties.DeploymentName, // Label = Convert.ToBase64String(Encoding.UTF8.GetBytes(cloudServiceName)) Label = properties.DeploymentName }; if (properties.VirtualNetwork != null) deployment.VirtualNetworkName = properties.VirtualNetwork.VirtualNetworkName; var roleList = new RoleList(); foreach (var role in roles) { role.RoleName = role.RoleName ?? namer.GetPureRandomValue(); roleList.Roles.Add(role); } deployment.RoleList = roleList; return deployment; }
/// <summary> /// Used to create a deployment and add any persistent vm role to the deployment /// </summary> /// <param name="role">The PersistentVMRole</param> /// <param name="cloudServiceName">The Name of the cloud service which the role is present in</param> /// <returns>The Deployment that is being used</returns> private static Deployment AddPersistentVMRole(string cloudServiceName, PersistentVMRole role) { var namer = new RandomAccountName(); var deployment = new Deployment { Name = cloudServiceName, // Label = Convert.ToBase64String(Encoding.UTF8.GetBytes(cloudServiceName)) Label = cloudServiceName }; role.RoleName = namer.GetPureRandomValue(); var roleList = new RoleList(); roleList.Roles.Add(role); deployment.RoleList = roleList; return deployment; }
/// <summary> /// Used to create a deployment and add any persistent vm role to the deployment /// </summary> /// <param name="properties"></param> /// <param name="role">The PersistentVMRole</param> /// <returns>The Deployment that is being used</returns> private static Deployment AddPersistentVMRole(WindowsVirtualMachineProperties properties, PersistentVMRole role) { var namer = new RandomAccountName(); var deployment = new Deployment { Name = properties.DeploymentName, // Label = Convert.ToBase64String(Encoding.UTF8.GetBytes(cloudServiceName)) Label = properties.DeploymentName }; role.RoleName = role.RoleName ?? namer.GetPureRandomValue(); var roleList = new RoleList(); roleList.Roles.Add(role); deployment.RoleList = roleList; return deployment; }