CloudServersProviderCreateServer Method |
Creates a new server.
Namespace: net.openstack.Providers.RackspaceAssembly: openstacknet (in openstacknet.dll) Version: 1.7.7+Branch.master.Sha.25d803f397c8693c2c13777ef6675f796f520f2c
Syntax public NewServer CreateServer(
string cloudServerName,
string imageName,
string flavor,
DiskConfiguration diskConfig = null,
Metadata metadata = null,
Personality[] personality = null,
bool attachToServiceNetwork = false,
bool attachToPublicNetwork = false,
IEnumerable<string> networks = null,
string region = null,
CloudIdentity identity = null
)
Public Function CreateServer (
cloudServerName As String,
imageName As String,
flavor As String,
Optional diskConfig As DiskConfiguration = Nothing,
Optional metadata As Metadata = Nothing,
Optional personality As Personality() = Nothing,
Optional attachToServiceNetwork As Boolean = false,
Optional attachToPublicNetwork As Boolean = false,
Optional networks As IEnumerable(Of String) = Nothing,
Optional region As String = Nothing,
Optional identity As CloudIdentity = Nothing
) As NewServer
public:
virtual NewServer^ CreateServer(
String^ cloudServerName,
String^ imageName,
String^ flavor,
DiskConfiguration^ diskConfig = nullptr,
Metadata^ metadata = nullptr,
array<Personality^>^ personality = nullptr,
bool attachToServiceNetwork = false,
bool attachToPublicNetwork = false,
IEnumerable<String^>^ networks = nullptr,
String^ region = nullptr,
CloudIdentity^ identity = nullptr
) sealed
abstract CreateServer :
cloudServerName : string *
imageName : string *
flavor : string *
?diskConfig : DiskConfiguration *
?metadata : Metadata *
?personality : Personality[] *
?attachToServiceNetwork : bool *
?attachToPublicNetwork : bool *
?networks : IEnumerable<string> *
?region : string *
?identity : CloudIdentity
(* Defaults:
let _diskConfig = defaultArg diskConfig null
let _metadata = defaultArg metadata null
let _personality = defaultArg personality null
let _attachToServiceNetwork = defaultArg attachToServiceNetwork false
let _attachToPublicNetwork = defaultArg attachToPublicNetwork false
let _networks = defaultArg networks null
let _region = defaultArg region null
let _identity = defaultArg identity null
*)
-> NewServer
override CreateServer :
cloudServerName : string *
imageName : string *
flavor : string *
?diskConfig : DiskConfiguration *
?metadata : Metadata *
?personality : Personality[] *
?attachToServiceNetwork : bool *
?attachToPublicNetwork : bool *
?networks : IEnumerable<string> *
?region : string *
?identity : CloudIdentity
(* Defaults:
let _diskConfig = defaultArg diskConfig null
let _metadata = defaultArg metadata null
let _personality = defaultArg personality null
let _attachToServiceNetwork = defaultArg attachToServiceNetwork false
let _attachToPublicNetwork = defaultArg attachToPublicNetwork false
let _networks = defaultArg networks null
let _region = defaultArg region null
let _identity = defaultArg identity null
*)
-> NewServer
Parameters
- cloudServerName
- Type: SystemString
Name of the cloud server. - imageName
- Type: SystemString
The image to use for the new server instance. This is
specified as an image ID (see Id) or a full URL. - flavor
- Type: SystemString
The flavor to use for the new server instance. This
is specified as a flavor ID (see Id) or a full URL. - diskConfig (Optional)
- Type: net.openstack.Core.DomainDiskConfiguration
The disk configuration. If the value is , the default configuration for the specified image is used. - metadata (Optional)
- Type: net.openstack.Core.DomainMetadata
The metadata to associate with the server. - personality (Optional)
- Type: net.openstack.Core.DomainPersonality
A collection of Personality objects describing the paths and contents of files to inject in the target file system during the creation process. If the value is , no files are injected. - attachToServiceNetwork (Optional)
- Type: SystemBoolean
if the private network will be attached to the newly created server; otherwise, . - attachToPublicNetwork (Optional)
- Type: SystemBoolean
if the public network will be attached to the newly created server; otherwise, . - networks (Optional)
- Type: System.Collections.GenericIEnumerableString
A collection of IDs of networks to attach to the server. This is obtained from CloudNetwork.Id. - region (Optional)
- Type: SystemString
The region in which to execute this action. If not specified, the user's default region will be used. - identity (Optional)
- Type: net.openstack.Core.DomainCloudIdentity
The cloud identity to use for this request. If not specified, the default identity for the current provider instance will be used.
Return Value
Type:
NewServerA
NewServer instance containing the details for the newly created server.
Implements
IComputeProviderCreateServer(String, String, String, DiskConfiguration, Metadata, Personality, Boolean, Boolean, IEnumerableString, String, CloudIdentity)Exceptions Exception | Condition |
---|
ArgumentNullException | cloudServerName is .
-or- imageName is . -or- flavor is . |
ArgumentException | cloudServerName is empty.
-or- imageName is empty. -or- flavor is empty. -or- metadata contains a value with a null or empty key. -or- networks contains a null or empty value. |
NotSupportedException |
If the provider does not support the given diskConfig.
-or- If the provider does not support the given identity type. -or- The specified region is not supported. |
InvalidOperationException |
If identity is and no default identity is available for the provider.
-or- If region is and no default region is available for the provider. |
ResponseException | If the REST API request failed. |
Remarks
This operation asynchronously provisions a new server. The progress of this operation depends on
several factors including location of the requested image, network i/o, host load, and the selected
flavor. The progress of the request can be checked by calling
GetDetails(String, String, CloudIdentity) and getting
the value of
Status and
Progress.
Notes to Callers |
---|
This is the only time the server's admin password is returned. Make sure to retain the value.
|
Version Information .NET Framework
Supported in: 4.5
openstack.net
Supported in: 1.6, 1.5, 1.4, 1.3.6
See Also