Skip to main content

Managing File Storage

Managing file storage volumes in Arvancloud Cloud Server.

Overview​

The file-storage commands provide tools for managing shared file volumes that multiple servers can access at the same time over the NFS protocol. File storage volumes are available through a private network within an Availability Zone.

Alias: fs

Commands​

1. Listing File Storage Volumes​

Shows the list of all file storage volumes, with filtering options.

arvan iaas file-storage 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 file-storage list --az=ir-central1-a

Output:

ID NAME STATUS SIZE (GB) NETWORK AZ
fs1a2b3c-5678-90ab-cdef-123456789012 shared-data available 100 private-net-01 ir-central1-a
fs2b3c4d-6789-01bc-def0-234567890123 app-storage available 200 vpc-network-02 ir-central1-a
fs3c4d5e-7890-12cd-ef01-345678901234 backup-fs available 500 private-net-01 ir-central1-b

2. Showing File Storage Details​

Shows detailed information about a specific file storage volume.

arvan iaas file-storage show <file-storage-id>

Alias: sh

Arguments:

  • file-storage-id (required): the file storage volume ID

Example:

$ arvan iaas file-storage show fs1a2b3c-5678-90ab-cdef-123456789012

Output:

FILE STORAGE VOLUME DETAILS
---------------------------
ID: fs1a2b3c-5678-90ab-cdef-123456789012
Name: shared-data
Status: available
AZ: ir-central1-a
Size (GB): 100
Connected Private Network: private-net-01
Connected Private Network ID: net-12345678-abcd-efgh-ijkl-123456789abc

Private IPs
• 192.168.1.10 (Network ID: subnet-12345678)
• 192.168.1.11 (Network ID: subnet-12345678)

Export Location Path:
192.168.1.10:/shares/share-abc123def456

ATTACHED TO
-----------
INSTANCE_ID INSTANCE OS ACCESS_LEVEL ACCESS_RIGHT_ID PRIVATE_IP
srv-11111111 web-server-01 Linux Read-Write ar-11111111-2222-3333-4444-555555555555 192.168.1.50
srv-22222222 app-server-01 Linux Read-Only ar-22222222-3333-4444-5555-666666666666 192.168.1.51

3. Creating File Storage​

Creates a new file storage volume.

arvan iaas file-storage create <new-file-storage-name>

Alias: cr

Arguments:

  • new-file-storage-name (required): the name of the new file storage volume

Flags:

  • --network, -n: the private network ID (required)
  • --az, -a: the data center to create the file storage in (required)
  • --size, -s: the volume size in GB (default: 50)
  • --force, -f: skip confirmation

Example:

$ arvan iaas file-storage create shared-storage --network=net-12345678 --az=ir-central1-a --size=150

Output:

CREATE NEW FILE STORAGE VOLUME
------------------------------
Name: shared-storage
Size (GB): 150
AZ: ir-central1-a
Network ID: net-12345678-abcd-efgh-ijkl-123456789abc
Network Name: private-net-01
CIDR: 192.168.1.0/24

Are you sure you want to create new file storage volume 'shared-storage' to network 'private-net-01' in AZ 'ir-central1-a? (y/n) y

New file storage volume 'shared-storage' is created under network ID 'net-12345678-abcd-efgh-ijkl-123456789abc'

4. Attaching File Storage​

Attaches a file storage volume to a server.

arvan iaas file-storage attach <file-storage-id>

Alias: att

Arguments:

  • file-storage-id (required): the ID of the file storage volume to attach

Flags:

  • --instance, -i: the server ID (required)
  • --access-level, -a: the server's access level (ro: read-only, rw: read-write; default: ro)
  • --force, -f: skip confirmation

Example:

$ arvan iaas file-storage attach fs1a2b3c-5678-90ab-cdef-123456789012 --instance=srv-12345678 --access-level=rw

Output:

ATTACH FILE STORAGE VOLUME TO SERVER
------------------------------------
Server: web-server-01 (srv-12345678)
File Storage Volume: shared-data (fs1a2b3c-5678-90ab-cdef-123456789012)
Subnet: private-net-01 (net-12345678-abcd-efgh-ijkl-123456789abc)
Size (GB): 100
Access Level: Read-Write
AZ: ir-central1-a

Are you sure you want to attach file storage volume 'shared-data' to instance(server) 'web-server-01'? (y/n) y

File Storage Volume 'shared-data' is attached to server ID 'srv-12345678'.

5. Detaching File Storage​

Detaches a file storage volume from a server.

arvan iaas file-storage detach <file-storage-id>

Alias: det

Arguments:

  • file-storage-id (required): the ID of the file storage volume to detach

Flags:

  • --access-right-id, -a: the ID of the access right that identifies the attached server (required)
  • --force, -f: skip confirmation

Example:

$ arvan iaas file-storage detach fs1a2b3c-5678-90ab-cdef-123456789012 --access-right-id=ar-11111111-2222-3333-4444-555555555555

Output:

DETACH FILE STORAGE VOLUME FROM SERVER
--------------------------------------
Server: web-server-01 (srv-12345678)
File Storage Volume: shared-data (fs1a2b3c-5678-90ab-cdef-123456789012)
Subnet: private-net-01 (net-12345678-abcd-efgh-ijkl-123456789abc)
Size (GB): 100
Access Level: Read-Write
AZ: ir-central1-a
Make sure all read/write operations have been completed. Otherwise, it can cause data loss.

Are you sure you want to detach file storage volume 'shared-data' from instance(server) 'web-server-01'? (y/n) y

File Storage Volume 'shared-data' is detached from server 'web-server-01'.

6. Renaming File Storage​

Changes the name of a file storage volume.

arvan iaas file-storage rename <file-storage-id> <new-name>

Alias: rn

Arguments:

  • file-storage-id (required): the ID of the file storage volume to rename
  • new-name (required): the new name of the file storage volume

Flags:

  • --force, -f: skip confirmation

Example:

$ arvan iaas file-storage rename fs1a2b3c-5678-90ab-cdef-123456789012 production-storage

Output:

RENAME FILE STORAGE VOLUME
--------------------------
Current Name: shared-data
New Name: production-storage
Current Size (GB): 100
AZ: ir-central1-a
Network Name: private-net-01

Are you sure you want to rename file storage volume 'shared-data' to 'production-storage'? (y/n) y

file storage volume 'shared-data' is renamed.

7. Resizing File Storage​

Increases the size of a file storage volume.

arvan iaas file-storage resize <file-storage-id> <new-volume-size>

Alias: in

Arguments:

  • file-storage-id (required): the ID of the file storage volume to resize
  • new-volume-size (required): the new size in GB (must be larger than the current size)

Flags:

  • --force, -f: skip confirmation

Example:

$ arvan iaas file-storage resize fs1a2b3c-5678-90ab-cdef-123456789012 200

Output:

INCREASE FILE STORAGE VOLUME SIZE
---------------------------------
Name: shared-data
Current Size (GB): 100
New Size (GB): 200
AZ: ir-central1-a
Network Name: private-net-01

Are you sure you want to increase the size of file storage volume 'shared-data'? (y/n) y

file storage volume 'shared-data' is resized.

Note that the size of file storage volumes can only be increased; it can't be decreased.

8. Deleting File Storage​

Deletes a file storage volume.

arvan iaas file-storage delete <file-storage-id>

Alias: del

Arguments:

  • file-storage-id (required): the ID of the file storage volume to delete

Flags:

  • --force, -f: skip confirmation

Example:

$ arvan iaas file-storage delete fs1a2b3c-5678-90ab-cdef-123456789012

Output:

DELETE NEW FILE STORAGE VOLUME
------------------------------
Name: shared-data
Size (GB): 100
AZ: ir-central1-a
Network ID: net-12345678-abcd-efgh-ijkl-123456789abc
Network Name: private-net-01

Private IPs
• 192.168.1.10 (Network ID: subnet-12345678)
• 192.168.1.11 (Network ID: subnet-12345678)

Are you sure you want to delete file storage volume 'shared-data'? (y/n) y

file storage volume 'shared-data' is deleted.

Note that deleting a file storage volume permanently erases all its data. After deletion, this space is no longer available to servers.

Command Reference​

CommandAliasDescriptionArguments
file-storage listlsList all file storage volumesNone
file-storage showshShow the details of a file storage volume<file-storage-id>
file-storage createcrCreate a new file storage volume<new-file-storage-name>
file-storage attachattAttach file storage to a server<file-storage-id>
file-storage detachdetDetach file storage from a server<file-storage-id>
file-storage renamernRename a file storage volume<file-storage-id> <new-name>
file-storage resizeinIncrease the size of a file storage volume<file-storage-id> <new-volume-size>
file-storage deletedelDelete a file storage volume<file-storage-id>

Best Practices​

  • Network connection: file storage volumes can only be accessed by servers connected to the same private network in the same Availability Zone.
  • NFS protocol: file storage uses the NFS protocol for shared access.
  • Multi-server access: multiple servers can access the same file storage volume at the same time.
  • Access levels:
    • ro (read-only): the server can only read data
    • rw (read-write): the server can read and write data
  • Size limit: file storage volumes can only be increased in size.