CreateServer() public méthode

public CreateServer ( string cloudServerName, string imageId, string flavor, string adminPass, string keyname = null, string nametag = null, string securityGroupNames = null, string attachVolumeIds = null, DiskConfiguration diskConfig = null, Metadata metadata = null, Personality personality = null, bool attachToServiceNetwork = false, bool attachToPublicNetwork = false, IEnumerable networks = null ) : NewServer
cloudServerName string
imageId string
flavor string
adminPass string
keyname string
nametag string
securityGroupNames string
attachVolumeIds string
diskConfig DiskConfiguration
metadata Metadata
personality Personality
attachToServiceNetwork bool
attachToPublicNetwork bool
networks IEnumerable
Résultat NewServer
 public void CreateServerTest_5times()
 {
     OpenStackMember os = null;
     NewServer server = null;
     var serverIds = new List<string>();
     try
     {
         os = new OpenStackMember(UserName, Password, TenantName, TenantId);
         var image = os.ListImages().First();
         for (int cnt = 1; cnt <= 15; cnt++)
         {
             IEnumerable<SimpleServer> servers = os.ListServers();
             var names = servers.GroupBy(s => s.Name, (key, g) => key);
             string[] data = Enumerable.Range(1, 100).Select(i => string.Format("{0}_{1}", TesterName, i)).ToArray<string>();
             string serverName = (from b in data where !names.Contains<string>(b) select b).First();
             server = os.CreateServer(serverName, image.Id, GetFlavorByName("g-1gb").Id, "D$fjhg5422mnM-");
             serverIds.Add(server.Id);
             Trace.WriteLine(String.Format("server creation transferred : {0}", DateTime.Now));
             Assert.IsNotNull(server);
             Assert.IsNotNull(server.AdminPassword);
             Trace.WriteLine(string.Format("ServerName : {0}", serverName));
             Trace.WriteLine(string.Format("AdminPassword : {0}", server.AdminPassword));
         }
     }
     finally
     {
         foreach (var serverId in serverIds)
         {
             bool bDelete = os.DeleteServer(serverId);
             Assert.IsTrue(bDelete);
             Trace.WriteLine(String.Format("server deletion transferred : {0}", DateTime.Now));
             os.ServersProvider.WaitForServerDeleted(serverId);
             Trace.WriteLine(String.Format("server deleted : {0}", DateTime.Now));
         }
     }
 }
        public void CreateServerTest()
        {
            var os = new OpenStackMember(UserName, Password, TenantName, TenantId);

            var image = os.ListImages().First();

            // decide server name which is not duplicated.
            IEnumerable<SimpleServer> servers = os.ListServers();
            var names = servers.GroupBy(s => s.Name, (key, g) => key);
            string[] data = Enumerable.Range(1, 100).Select(i => string.Format("{0}_{1}", TesterName, i)).ToArray<string>();
            string serverName = (from b in data where !names.Contains<string>(b) select b).First();

            // create server
            // the name tag must not contain space
            NewServer server = os.CreateServer(serverName, image.Id, GetFlavorByName("g-1gb").Id, "S5df!Afdas%'Zt", keyname: null, nametag: "test_nametag", networks: null);
            Trace.WriteLine(String.Format("server creation transferred : {0}", DateTime.Now));
            Assert.IsNotNull(server);
            Assert.IsNotNull(server.AdminPassword);
            Trace.WriteLine(string.Format("ServerName : {0}", serverName));
            Trace.WriteLine(string.Format("AdminPassword : {0}", server.AdminPassword));

            // wait for activate
            os.ServersProvider.WaitForServerActive(server.Id);
            Trace.WriteLine(String.Format("server activated : {0}", DateTime.Now));

            bool bDelete = os.DeleteServer(server.Id);
            Assert.IsTrue(bDelete);
            Trace.WriteLine(String.Format("server deletion transferred : {0}", DateTime.Now));

            // wait for delete
            os.ServersProvider.WaitForServerDeleted(server.Id);
            Trace.WriteLine(String.Format("server deleted : {0}", DateTime.Now));
        }