Click or drag to resize
CloudServersProviderCreateServer Method
Creates a new server.

Namespace: net.openstack.Providers.Rackspace
Assembly: 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
)

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: NewServer
A NewServer instance containing the details for the newly created server.

Implements

IComputeProviderCreateServer(String, String, String, DiskConfiguration, Metadata, Personality, Boolean, Boolean, IEnumerableString, String, CloudIdentity)
Exceptions
ExceptionCondition
ArgumentNullExceptioncloudServerName is .

-or-

imageName is .

-or-

flavor is .

ArgumentExceptioncloudServerName 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.

ResponseExceptionIf 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.
Note Notes to Callers
This is the only time the server's admin password is returned. Make sure to retain the value.
Note Note
The diskConfig parameter is ignored if the provider does not support the disk configuration extension.
Version Information

.NET Framework

Supported in: 4.5

openstack.net

Supported in: 1.6, 1.5, 1.4, 1.3.6
See Also