openstack Verified current stable Not installed? Networking

Openstack / Create New Server

Create New Server

Create a new server instance in OpenStack with specified image and flavor.

$
Terminal
openstack server create --image <image_id> --flavor <flavor_id> --network <network_id> --wait <server_name>

When To Use

During provisioning of new compute resources as part of an automated deployment pipeline.

Pro Tip

Utilize `--security-group` to add security restrictions during creation, mitigating future vulnerabilities.

Anatomy of Output

Understanding the result

+--------------------------------------+---------+----------+ Output Header

Details new server ID and status.

| ID | Name | Status | Column Details

Displays created server details.

| 789012bc-abcd-ef00-7777-88990000eeff | new-server | ACTIVE | New Server Entry

Indicates successful creation and activation of the server.

Troubleshooting

Common pitfalls

Image not found (HTTP 404)

Solution: Verify the provided image ID matches an available image.

Flavor not found (HTTP 404)

Solution: Ensure the specified flavor ID is correct and available.

Conflict (HTTP 409)

Solution: A server with that name already exists; use a unique server name.

Command Breakdown

What each part is doing

openstack
Base Command
The executable that performs this operation. Here it runs Openstack before the shell applies any redirect operators.
<image_id>
image id
The value supplied for image id.
<flavor_id>
flavor id
The value supplied for flavor id.
<network_id>
network id
The value supplied for network id.
<server_name>
server name
The host or server name supplied to this command.
--image
Command Option
Tool-specific option used by this command invocation.
--flavor
Command Option
Tool-specific option used by this command invocation.
--network
Command Option
Tool-specific option used by this command invocation.
--wait
Command Option
Tool-specific option used by this command invocation.

Alternative Approaches

Comparable commands in other tools

Alternative networking tools for the same job.