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 [options]

PARAMETERS

create
    Create a new server instance.

delete
    Delete one or more server instances.

list
    List available server instances.

show
    Show detailed information about a specific server instance.

reboot
    Reboot a server instance.

resize
    Resize a server instance to a different flavor.

start
    Start a stopped server instance.

stop
    Stop a running server instance.

suspend
    Suspend a server instance.

resume
    Resume a suspended server instance.

migrate
    Migrate a server instance to a different host.

live-migrate
    Live migrate a server instance to a different host.

console log
    Show console log of a server instance.

--image
    Image to use to create the server.

--flavor
    Flavor to use to create the server.

--nic
    Network to connect the server instance to.

--security-group
    Security group to apply to the server instance.

--key-name
    Key pair to inject into the server instance.

DESCRIPTION

The `openstack server` command provides a comprehensive interface for managing compute instances (servers) within an OpenStack cloud environment. It allows users to create, list, show details of, update, delete, and perform various actions on virtual machines. This command is a part of the OpenStack client CLI and interacts with the Nova compute service API. Key functionalities include:
Launching new instances from images or volumes, specifying flavors (resource allocations), managing security groups, assigning floating IPs, and monitoring server status. It also enables tasks like console access, rebooting, resizing, snapshotting, and attaching/detaching volumes. Essentially, `openstack server` serves as a central tool for interacting with the virtual servers running in the OpenStack cloud, enabling administrators and users to efficiently manage their compute resources.

CAVEATS

Requires OpenStack client to be configured and properly authenticated against an OpenStack cloud. Correct permissions are necessary for performing actions on server instances.

EXAMPLE - CREATING A SERVER

openstack server create --image ubuntu-20.04 --flavor m1.small my-new-server
This command creates a new server named 'my-new-server' using the 'ubuntu-20.04' image and the 'm1.small' flavor.

EXAMPLE - GETTING SERVER DETAILS

openstack server show my-new-server
Show details of the server instance called 'my-new-server'

HISTORY

The `openstack server` command evolved as part of the unified OpenStack client project, aiming to provide a consistent and user-friendly interface for interacting with various OpenStack services. It replaced older, service-specific CLIs like `nova` client. Its development has been driven by the need for a single tool to manage the OpenStack infrastructure.

SEE ALSO

openstack image(1), openstack flavor(1), openstack network(1), nova(1)

Copied to clipboard