Các lệnh thông dụng

Cloud Server

Danh sách server: bizfly server list
$ bizfly server list
Using config file: /home/sapd/.bizfly.yaml
+--------------------------------------+---------------+----------+--------+-----------+--------------+----------------+----------------------+
|                  ID                  |     NAME      | KEY NAME | STATUS |  FLAVOR   |    LAN IP    |     WAN IP     |      CREATED AT      |
+--------------------------------------+---------------+----------+--------+-----------+--------------+----------------+----------------------+
| 66c98ca5-16ea-40a5-b8d9-633e56b39b5e | sapd-test-hcm |          | ACTIVE | nix.2c_2g | 10.20.149.80 | 103.153.73.209 | 2021-01-27T07:10:33Z |
+--------------------------------------+---------------+----------+--------+-----------+--------------+----------------+----------------------+

Danh sách flavor: bizfly flavor list
$ bizfly flavor list
Using config file: /home/sapd/.bizfly.yaml
+--------------------------+---------+
|            ID            |  NAME   |
+--------------------------+---------+
| 5d7f58903c4c0127da9896ae | 1c_1g   |
| 5d7f58903c4c0127da9896b5 | 2c_4g   |
| 5d7f58903c4c0127da9896d9 | 12c_32g |
| 5d7f58903c4c0127da9896c3 | 4c_12g  |
| 5d7f58903c4c0127da9896b3 | 2c_2g   |
| 5d7f58903c4c0127da9896b2 | 2c_1g   |
| 5d7f58903c4c0127da9896bb | 3c_6g   |
| 5d7f58903c4c0127da9896b0 | 1c_3g   |
| 5d7f58903c4c0127da9896b4 | 2c_3g   |
| 5d7f58903c4c0127da9896c7 | 6c_6g   |
| 5d7f58903c4c0127da9896af | 1c_2g   |
....
Danh sách image trong 1 region: bizfly image list
sapd@sapd ~ $ bizfly image list 
Using config file: /home/sapd/.bizfly.yaml
+--------------------------------------+--------------+--------------------+
|                  ID                  | DISTRIBUTION |      VERSION       |
+--------------------------------------+--------------+--------------------+
| 5f218529-ce32-4cb6-8557-920b16307d35 | Ubuntu       | 20.04 x64          |
| 82774ccd-f0f7-4858-9367-fd1cd819d8a9 | Ubuntu       | 18.04 x64          |
| 8a962d55-7d71-4306-93b9-97c81583a44a | Ubuntu       | 16.04 x64          |
| 83aeff78-14ad-498d-976b-ed15bc5fa5ac | Ubuntu       | 14.04 x64          |
| 4cdbe57f-6ba1-4f40-a6fb-beb1ed974168 | CentOS       | 8.0 x64            |
| 664dff79-3b3f-4c31-9251-7e0c9ad6a7c7 | CentOS       | 7.7 x64            |
| 0261c925-a120-4f91-a831-16bd11a72e94 | CentOS       | 6.10 x64           |
| 78476d38-e1e6-46fa-ac98-be7c6b769287 | CentOS       | 6.9 x64            |
| 67585718-6a13-44f3-8ec0-4b427d922c0f | CentOS       | 6.8 x64            |
| 1b8d6895-870b-4255-ae4b-2c22251820c6 | Debian       | 9 x64              |
| 1f57e52d-244d-41c2-8313-e2340a19cd1c | Debian       | 10 x64             |
| 31f6c010-92d8-4327-92f1-a16bd876b438 | Windows      | 2019 Standard      |
| 9e09a71c-ceed-4f00-aeea-ed3c7d391807 | Windows      | 2016 Standard      |
| 91dff6d8-e26b-4b9a-9299-f74ee8a3de02 | Windows      | 2016 Datacenter    |
| 01174cec-4b24-4164-80df-ea51b9b7353b | Windows      | 2012 R2 Standard   |
| 3a5b0154-db9c-4e16-8556-007c500bbfd2 | Windows      | 2012 R2 Datacenter |
| a13fc6ac-7134-45d3-9191-146afe34860e | Windows      | 2008 R2 Enterprise |
| d12fc79e-abc1-4de8-8d3c-c97a824981c7 | SUSE         | SLES 15 SP2        |
| cc32cc35-bc04-4553-b299-effb990c5874 | SUSE         | OpenSUSE LEAP 15   |
+--------------------------------------+--------------+--------------------+
Khởi tạo Cloud Server

Để khởi tạo một Cloud Server, ta cần các tham số sau:

  • --availability-zone: Availability Zone Cloud Server sẽ thực hiện tạo. Hỗ trợ các giá trị: HN1, HN2HCM1

  • --category: Dòng của Cloud Server. Hỗ trợ các giá trị: basic, premium, enterprise, dedicated

  • --flavor: Cấu hình RAM và CPU của Cloud Server

  • --image-id: ID của hệ điều hành (image)

  • --name: Tên Cloud Server

  • --rootdisk-size: Kích thước ổ cứng rootdisk

  • --rootdisk-type: Loại ổ cứng của Cloud Server. HDD hoặc SSD

  • --ssh-key: Tên của SSH key cho Cloud Server

  • --snapshot-id (tùy chọn): Khởi tạo Cloud Server từ một Snapshot

  • --volume-id (tùy chọn): Khởi tạo Cloud Server từ một rootdisk có sẵn

Ví dụ tạo một Cloud Server tại Region HCM, AZ HCM1, dòng basic, image id 5f218529-ce32-4cb6-8557-920b16307d35, kích thước ổ cứng rootdisk 20GB loại SSD

bizfly server create --region HCM --availability-zone HCM1 --category basic --flavor 1c_1g --image-id 5f218529-ce32-4cb6-8557-920b16307d35 --name test-create-cli  --rootdisk-size 20 --rootdisk-type SSD
Xóa 1 Cloud Server: bizfly server delete <server id>
Reboot 1 Cloud Server: bizfly server reboot <server id>
Stop 1 Cloud Server: bizfly server stop <server id>
Start 1 Cloud Server: bizfly server start <server id>
Resize 1 Cloud Server: bizfly server resize --flavor <new flavor> <server id>
Danh sách Volume: bizfly volume list
sapd@sapd ~ $ bizfly volume list
Using config file: /home/sapd/.bizfly.yaml
+--------------------------------------+-------------------------------------------------------+-----------+------+----------------------------+------+--------------------------------------+
|                  ID                  |                         NAME                          |  STATUS   | SIZE |         CREATED AT         | TYPE |             SNAPSHOT ID              |
+--------------------------------------+-------------------------------------------------------+-----------+------+----------------------------+------+--------------------------------------+
| 5ecaa587-1e6c-4b6d-bfe7-bc43c6b69c9e | ubuntu-4vcpu-4gb-01_rootdisk                          | in-use    | 40   | 2021-01-27T09:03:53.000000 | HDD  |                                      |
| 82ba0f21-c6ec-46e6-abbe-58b38513d0f8 | test-free-bw_rootdisk                                 | in-use    | 40   | 2021-01-26T10:11:07.000000 | HDD  |                                      |
| 9c4550ce-b3e7-4784-933c-42a03a1c10ae | pool-xggtobg7-e9xb1wqgbdu9lkva-node-npZLZ169_rootdisk | in-use    | 50   | 2021-01-21T04:20:27.000000 | HDD  |                                      |
| 91b660cc-6ef6-4589-a52f-df5d80ae9977 | ubuntu-2vcp_rootdisk                                  | available | 40   | 2021-01-21T02:25:59.000000 | HDD  |                                      |
| 88e09ea9-6e2d-4dab-a0a9-65dfe2b9ef64 | sapd-te123_rootdisk                                   | available | 40   | 2021-01-20T08:56:41.000000 | HDD  |                                      |
| 9e374b43-44bb-4e39-ba2d-46489d17bde0 | ubuntu-2v_rootdisk                                    | available | 40   | 2021-01-20T06:47:22.000000 | HDD  |                                      |