Skip to main content

Managing Servers

Managing Arvancloud Cloud Server servers through the CLI.

Overview​

The server commands provide the tools you need to create, manage, and control servers. With these commands, you can set up, monitor, and manage the servers of your cloud infrastructure.

Alias: srv

Commands​

1. Listing Servers​

Shows the list of all servers, with filtering options.

arvan iaas server list

Alias: ls

Flags:

  • --region, -r: filter by region code (optional) Example: ir-central1
  • --az, -a: filter by data center (optional) Example: ir-central1-a

Example:

$ arvan iaas server list --region=ir-central1

Output:

ID NAME STATUS AZ FLAVOR IMAGE IP
srv-12345678 web-server-01 ACTIVE ir-central1-a g1-2-4 Ubuntu 22.04 185.10.200.15
srv-23456789 db-server-01 ACTIVE ir-central1-a g1-4-8 CentOS 8 185.10.200.16
srv-34567890 app-server-02 SHUTOFF ir-central1-b g1-1-2 Debian 11 -

2. Showing Server Details​

Shows the full information of a specific server.

arvan iaas server show <server-id>

Alias: sh

Arguments:

  • server-id (required): the server ID

Example:

$ arvan iaas server show srv-12345678

Output:

SERVER DETAILS
--------------
ID: srv-12345678
Name: web-server-01
Status: ACTIVE
AZ: ir-central1-a
Flavor: g1-2-4 (2 vCPUs, 4 GB RAM)
Image: Ubuntu 22.04 LTS
Created: Jan 10 2025 08:30:00 UTC


NETWORK INTERFACES
------------------
NETWORK IP TYPE MAC PORT_ID PORT_SECURITY SECURITY_GROUPS PTR
public-network 185.10.200.15 Public fa:16:3e:aa:bb:cc port-abc123 Enabled default web.example.com
private-net-01 10.0.1.10 Private fa:16:3e:dd:ee:ff port-def456 Enabled default -


VOLUMES
-------
DEVICE VOLUME ID SIZE
/dev/vda vol-1a2b3c4d-5678-90ab-cdef-12345678 50 GB
/dev/vdb vol-2b3c4d5e-6789-01bc-def0-23456789 100 GB

Notes:

  • In the network interfaces table, PTR records (reverse DNS) are shown for public IPs.
  • The port security status and firewall groups are shown for each network interface.
  • The server's creation time is shown with its time zone.

3. Creating a Server​

Creates a new server.

arvan iaas server create

Alias: cr

Flags:

  • --name, -n: the name of the new server (required)
  • --flavor, -f: the flavor ID (required)
  • --image-id, -i: the image ID (required unless you use --snapshot-id)
  • --az, -a: the data center (AZ) to create the server in (required)
  • --security-groups: firewall group IDs (can be specified multiple times)
  • --disk-size, -d: the disk size in GB
  • --ssh-key, -k: the SSH key name
  • --networks: network IDs (can be specified multiple times)
  • --ha: enable high availability
  • --ipv4: enable IPv4 (default: enabled)
  • --ipv6: enable IPv6
  • --snapshot-id, -s: the ID of a snapshot to create the server from
  • --backup-slot-id, -b: the ID of a backup slot to create the server from
  • --volume-attachment: non-root volumes to attach to the server (can be specified multiple times)
  • --backup-name: the backup profile name (only when using --enable-backup; default: the server name)
  • --enable-backup: enable automatic backup
  • --force: skip confirmation

Example:

$ arvan iaas server create \
--name=web-server-02 \
--flavor=g3-16-2-0 \
--image-id=793cdb82-c731-4aeb-808d-19da98525a02 \
--az=ir-central1-a \
--disk-size=25 \
--ssh-key=Alo \
--security-groups=97986294-f54a-46d8-a5d8-c953dfbe747d \
--ipv4

Output:

SERVER CREATED
--------------
ID: 6924881f-ab13-4fcd-8d42-f41daf413db8
Name: cli-test-server
Flavor: g3-16-2-0
Image: 793cdb82-c731-4aeb-808d-19da98525a02
AZ: ir-central1-a

Notes:

  • At least one firewall group is required to create a server.
  • To make sure there is enough space, set --disk-size (at least 25 GB is recommended).
  • To check an image's requirements, use arvan iaas image show <image-id>.
  • To see the available flavors, use arvan iaas flavor list --az <zone>.
  • To see the available firewall groups, use arvan iaas security-group list --az <zone>.
  • To see the available SSH keys, use arvan iaas ssh-key list --az <zone>.

4. Powering On a Server​

Turns on a server that is off.

arvan iaas server poweron <server-id>

Alias: pon

Arguments:

  • server-id (required): the ID of the server you want to turn on

Example:

$ arvan iaas server poweron srv-12345678

Output:

SERVER POWER ON
---------------
ID: srv-12345678
Name: web-server-01
Status: Starting

Server is powering on...

5. Powering Off a Server​

Turns off a running server.

arvan iaas server poweroff <server-id>

Alias: pof

Arguments:

  • server-id (required): the ID of the server you want to turn off

Example:

$ arvan iaas server poweroff srv-12345678

Output:

SERVER POWER OFF
----------------
ID: srv-12345678
Name: web-server-01
Status: Stopping

Server is powering off...

6. Rebooting a Server​

Restarts a running server.

arvan iaas server reboot <server-id>

Alias: rb

Arguments:

  • server-id (required): the ID of the server you want to restart

Example:

$ arvan iaas server reboot srv-12345678

Output:

SERVER REBOOT
-------------
ID: srv-12345678
Name: web-server-01
Status: Rebooting

Server is rebooting...

7. Renaming a Server​

Changes the name of a server.

arvan iaas server rename <server-id>

Alias: rn

Arguments:

  • server-id (required): the server ID

Flags:

  • --new-name, -n: the server's new name (required)

Example:

$ arvan iaas server rename srv-12345678 --new-name=production-web-01

Output:

SERVER RENAMED
--------------
ID: srv-12345678
Old Name: web-server-01
New Name: production-web-01

Server renamed successfully!

8. Resetting the Server's Root Password​

Resets the server's root password. This operation generates and shows a new random password.

arvan iaas server reset-pass <server-id>

Alias: rp

Arguments:

  • server-id (required): the server ID

Flags:

  • --force, -f: skip confirmation

Example:

$ arvan iaas server reset-pass 747a7d8a-7de6-4b83-9048-81cd74ca3f20

Output:

⚠️ Are you sure you want to reset the root password for server '747a7d8a-7de6-4b83-9048-81cd74ca3f20'? (y/n) y

PASSWORD RESET SUCCESSFUL:
Server ID: 747a7d8a-7de6-4b83-9048-81cd74ca3f20
New Root Password: KJJLECubrg

Example with the --force flag:

$ arvan iaas server reset-pass 747a7d8a-7de6-4b83-9048-81cd74ca3f20 --force

Output:

PASSWORD RESET SUCCESSFUL:
Server ID: 747a7d8a-7de6-4b83-9048-81cd74ca3f20
New Root Password: KJJLECubrg

Notes:

  • This operation resets the root password immediately.
  • Save the new password in a secure place; it can't be recovered again.
  • To skip confirmation in automated scripts, use --force.
  • The password is generated randomly by the server.

Gets a VNC console link for accessing the server's virtual console. This link is valid for 20 minutes.

arvan iaas server get-vnc-link <server-id>

Alias: vnc

Arguments:

  • server-id (required): the server ID

Example:

$ arvan iaas server get-vnc-link 747a7d8a-7de6-4b83-9048-81cd74ca3f20

Output:

VNC CONSOLE LINK:
Server ID: 747a7d8a-7de6-4b83-9048-81cd74ca3f20
VNC URL: https://console.arvaniaas.ir/ir-thr-ba1/vnc_auto.html?token=85d5db66-f00a-4593-bc16-7b2ea46b16c4
Note: This link is valid for 20 minutes

Notes:

  • The VNC link gives browser access to the server's console.
  • For security reasons, the link expires after 20 minutes.
  • When SSH isn't available, you can use this method to connect to the server.
  • It is very useful for troubleshooting boot or network problems.

10. Terminating a Server​

Terminates a server.

Unlike deletion, the server still exists but becomes non-operational. Use this command when you want to disable a server permanently without deleting it. When needed, this operation can be reversed with the poweron command.

arvan iaas server terminate <server-id>

Alias: term

Arguments:

  • server-id (required): the server ID

Flags:

  • --force, -f: skip confirmation

Example:

$ arvan iaas server terminate srv-12345678

Output:

SERVER TO TERMINATE
-------------------
ID: srv-12345678
Name: web-server-01
Status: ACTIVE
Flavor: g1-2-4
Image: Ubuntu 22.04
AZ: ir-central1-a


Are you sure you want to terminate server 'web-server-01'? (y/n) y

✓ SERVER TERMINATED SUCCESSFULLY
---------------------------------
Server ID: srv-12345678
Server Name: web-server-01

Notes:

  • This operation is different from deleting the server; in this case, the server still exists.
  • To skip confirmation in automated scripts, use --force.
  • This operation isn't permanent and can be reversed with the poweron command.

11. Deleting a Server​

Deletes a server. If the server has backups or snapshots, you are first asked to delete them.

arvan iaas server delete <server-id>

Alias: del

Arguments:

  • server-id (required): the server ID

Flags:

  • --force, -f: skip confirmation

Example:

$ arvan iaas server delete srv-12345678

Output (without dependencies):

SERVER TO DELETE
----------------
ID: srv-12345678
Name: web-server-01
Status: ACTIVE
Flavor: g1-2-4
Image: Ubuntu 22.04
AZ: ir-central1-a

Are you sure you want to delete server 'web-server-01'? (y/n) y

✓ SERVER DELETED SUCCESSFULLY
------------------------------
Server ID: srv-12345678
Server Name: web-server-01

Output (with dependencies):

SERVER TO DELETE
----------------
ID: srv-12345678
Name: web-server-01
Status: ACTIVE
Flavor: g1-2-4
Image: Ubuntu 22.04
AZ: ir-central1-a

⚠️ WARNING: ASSOCIATED RESOURCES FOUND
----------------------------------------
Snapshots: 1 snapshot(s) found
- Snapshot: web-server-snapshot (snap-abc12345)

These resources must be deleted before deleting the server.

Do you want to delete these associated resources? (y/n) y

Deleting snapshots...
✓ Deleted snapshot: web-server-snapshot

Are you sure you want to delete server 'web-server-01'? (y/n) y

✓ SERVER DELETED SUCCESSFULLY
------------------------------
Server ID: srv-12345678
Server Name: web-server-01

Associated Resources Deleted:
Snapshots: 1

Notes:

  • The command automatically detects related backups and snapshots.
  • Before deleting the server, you need to confirm the dependencies.
  • To skip all confirmations in automated scripts, use --force.
  • Deleting a server is permanent and can't be undone.

Command Reference​

CommandAliasDescriptionArguments
server listlsList all serversNone
server showshShow the details of a server<server-id>
server createcrCreate a new serverNone
server poweronponPower on a server<server-id>
server poweroffpofPower off a server<server-id>
server rebootrbRestart a server<server-id>
server renamernRename a server<server-id>
server reset-passrpReset the server's root password<server-id>
server get-vnc-linkvncGet the VNC console link<server-id>
server terminatetermTerminate a server (reversible with poweron)<server-id>
server deletedelDelete a server<server-id>