LinuxCommandLibrary

openstack-server

Manage OpenStack compute server instances

TLDR

List servers

$ openstack server list
copy

Start server(s)
$ openstack server start [instance_id1 instance_id2 ...]
copy

Stop server
$ openstack server stop [instance_id1 instance_id2 ...]
copy

Create new server
$ openstack server create --image [image_id] --flavor [flavor_id] --network [network_id] --wait [server_name]
copy

Delete server(s)
$ openstack server delete [instance_id1 instance_id2 ...]
copy

Migrate server to different host
$ openstack server migrate --live [host_hostname] [--shared-migration|--block-migration] --wait [instance_id]
copy

Perform a soft or hard reset to the server
$ openstack server reboot [--soft|--hard] --wait [instance_id]
copy

SYNOPSIS

openstack server <subcommand> [options] [arguments]

Common examples:
openstack server create [options] <server-name>
openstack server list [options]

PARAMETERS

--image <image>
    Specify the image name or ID to use when creating a server. (Used with openstack server create)

--flavor <flavor>
    Specify the flavor name or ID (defines vCPU, RAM, disk size) for the server. (Used with openstack server create)

--network <network>
    Specify the network name or ID to attach the server to. Can be used multiple times. (Used with openstack server create)

--security-group <group>
    Specify a security group name or ID to apply to the server. Can be used multiple times. (Used with openstack server create)

--key-pair <key-pair>
    Specify the name of the key pair to inject into the server, enabling SSH access. (Used with openstack server create)

--volume <volume>
    Attach an existing volume to the server. (Used with openstack server create)

--boot-from-volume <size>
    Create and boot a server from a new volume of the specified size (in GiB). (Used with openstack server create)

--user-data <file>
    Specify a file containing user data to be executed on first boot. (Used with openstack server create)

--wait
    Wait for the command to complete, e.g., for server creation to finish provisioning. (Used with openstack server create)

--long
    List additional fields in output, such as image ID, flavor ID, or network ID. (Used with openstack server list)

--all-projects
    List resources from all projects (requires administrative privileges). (Used with openstack server list)

DESCRIPTION

The command refers to the openstack server subcommand group of the unified OpenStack client. It provides a comprehensive interface for users to interact with and manage virtual machine instances (also known as servers or compute instances) within an OpenStack cloud environment.

Users can perform a wide array of operations including provisioning new instances, listing existing ones, viewing detailed information about a specific server, and managing their lifecycle (starting, stopping, rebooting, suspending, resuming). It also allows for advanced configurations such as attaching volumes, managing security groups, injecting user data, and configuring networks, making it a critical tool for cloud administrators and developers alike to control their compute resources efficiently and programmatically.

CAVEATS

The term "openstack-server" is not a standalone executable command. It refers to the server management capabilities accessed via the openstack client using its server subcommand group (e.g., openstack server create, openstack server list).

Usage requires the OpenStack client library to be installed and properly configured with valid credentials (e.g., via environment variables like OS_CLOUD or OS_AUTH_URL, OS_USERNAME, etc.) to connect to an OpenStack cloud. Permissions granted to the authenticated user determine which operations can be performed.

COMMON SERVER SUBCOMMANDS

Beyond creating servers, the openstack server group offers a rich set of subcommands for managing instances:
list: Displays a list of all accessible servers.
show <server>: Shows detailed information about a specific server.
delete <server>: Deletes one or more servers.
reboot <server>: Reboots a server.
start <server>: Starts a stopped server.
stop <server>: Stops a running server.

AUTHENTICATION AND CONFIGURATION

To use the openstack client, you must configure your environment for authentication. This typically involves setting environment variables (e.g., OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, OS_PROJECT_NAME) or using a clouds.yaml file and setting the OS_CLOUD environment variable. These credentials allow the client to connect to your OpenStack cloud and perform operations.

HISTORY

Before the unified openstack client, users would often interact with various OpenStack services using separate client tools, such as nova client for compute (servers), glance client for images, and neutron client for networking. The openstack client was developed to consolidate these disparate tools into a single, consistent command-line interface. The server subcommands encapsulate the core functionality previously offered by the nova client, providing a more streamlined and intuitive experience for managing virtual machines across the entire OpenStack ecosystem.

SEE ALSO

openstack(1), openstack image (part of openstack client), openstack flavor (part of openstack client), openstack network (part of openstack client), nova (OpenStack Compute service)

Copied to clipboard