2019-11-15 16:11:45 +00:00
|
|
|
Usage Guide For End Users
|
|
|
|
=========================
|
|
|
|
|
|
|
|
Create VM
|
|
|
|
---------
|
|
|
|
|
2019-12-03 10:40:41 +00:00
|
|
|
The following command would create a Virtual Machine (name: meow)
|
|
|
|
with following specs
|
2019-11-15 16:11:45 +00:00
|
|
|
|
|
|
|
* CPU: 1
|
|
|
|
* RAM: 1GB
|
|
|
|
* OS-SSD: 4GB
|
|
|
|
* OS: Alpine Linux
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
ucloud-cli vm create --vm-name meow --cpu 1 --ram '1gb' --os-ssd '4gb' --image images:alpine
|
|
|
|
|
|
|
|
|
|
|
|
.. _how-to-check-vm-status:
|
|
|
|
|
|
|
|
Check VM Status
|
|
|
|
---------------
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
ucloud-cli vm status --vm-name meow
|
|
|
|
|
|
|
|
.. code-block:: json
|
|
|
|
|
|
|
|
{
|
|
|
|
"hostname": "/v1/host/74c21c332f664972bf5078e8de080eea",
|
|
|
|
"image_uuid": "3f75bd20-45d6-4013-89c4-7fceaedc8dda",
|
|
|
|
"in_migration": null,
|
|
|
|
"log": [
|
|
|
|
"2019-11-12T09:11:09.800798 - Started successfully"
|
|
|
|
],
|
|
|
|
"metadata": {
|
|
|
|
"ssh-keys": []
|
|
|
|
},
|
|
|
|
"name": "meow",
|
|
|
|
"network": [],
|
|
|
|
"owner": "admin",
|
|
|
|
"owner_realm": "ungleich-admin",
|
|
|
|
"specs": {
|
|
|
|
"cpu": 1,
|
|
|
|
"hdd": [],
|
|
|
|
"os-ssd": "4.0 GB",
|
|
|
|
"ram": "1.0 GB"
|
|
|
|
},
|
|
|
|
"status": "RUNNING",
|
|
|
|
"vnc_socket": "/tmp/tmpj1k6sdo_"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Connect to VM using VNC
|
|
|
|
-----------------------
|
|
|
|
|
2019-12-03 10:40:41 +00:00
|
|
|
We would need **socat** utility and a remote desktop client
|
|
|
|
e.g Remmina, KRDC etc. We can get the vnc socket path by getting
|
|
|
|
its status, see :ref:`how-to-check-vm-status`.
|
2019-11-15 16:11:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
socat TCP-LISTEN:1234,reuseaddr,fork UNIX-CLIENT:/tmp/tmpj1k6sdo_
|
|
|
|
|
|
|
|
|
|
|
|
Then, launch your remote desktop client and connect to vnc://localhost:1234.
|
|
|
|
|
|
|
|
Create Network
|
|
|
|
--------------
|
|
|
|
|
2019-11-27 07:12:29 +00:00
|
|
|
Layer 2 Network with sample IPv6 range fd00::/64 (without IPAM and routing)
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2019-11-15 16:11:45 +00:00
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
ucloud-cli network create --network-name mynet --network-type vxlan
|
|
|
|
|
|
|
|
|
2019-11-27 07:12:29 +00:00
|
|
|
Layer 2 Network with /64 network with automatic IPAM
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
.. code-block:: sh
|
2019-11-15 16:11:45 +00:00
|
|
|
|
2019-11-27 07:12:29 +00:00
|
|
|
ucloud-cli network create --network-name mynet --network-type vxlan --user True
|
2019-11-15 16:11:45 +00:00
|
|
|
|
2019-11-27 07:12:29 +00:00
|
|
|
Attach Network to VM
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
Currently, user can only attach network to his/her VM at
|
|
|
|
the time of creation. A sample command to create VM with
|
|
|
|
a network is as follow
|
2019-11-15 16:11:45 +00:00
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
ucloud-cli vm create --vm-name meow2 --cpu 1 --ram '1gb' --os-ssd '4gb' --image images:alpine --network mynet
|
|
|
|
|
2019-11-27 07:12:29 +00:00
|
|
|
.. _get-list-of-hosts:
|
|
|
|
|
|
|
|
Get List of Hosts
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
ucloud-cli host list
|
|
|
|
|
|
|
|
|
|
|
|
Migrate VM
|
|
|
|
----------
|
|
|
|
|
|
|
|
.. code-block:: sh
|
|
|
|
|
|
|
|
ucloud-cli vm migrate --vm-name meow --destination server1.place10
|
|
|
|
|
|
|
|
|
|
|
|
.. option:: --destination
|
2019-11-15 16:11:45 +00:00
|
|
|
|
2019-11-27 07:12:29 +00:00
|
|
|
The name of destination host. You can find a list of host
|
|
|
|
using :ref:`get-list-of-hosts`
|