This is used as the underlying wrapper for the deployment of the virtual machine
상속: ICustomXmlSerializer
예제 #1
0
        /// <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());
        }
예제 #2
0
        /// <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());
        }
예제 #3
0
        /// <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;
        }
예제 #4
0
 /// <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;
 }
예제 #5
0
 /// <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;
 }