Launch an instance
Most cloud images support public key authentication rather than conventional password authentication. Before launching an instance, you must add a public key to the Compute service.
First, generate a key pair (e.g. by running ssh-keygen). Remember to store securely the public and private keys, otherwise, you will lose access to your instances
$ fedcloud openstack --site CESNET-MCC --vo university.eosc-synergy.eu \
keypair create \
--public-key PATH-TO-PUBLIC-KEY \
KEY-NAME
Site: CESNET-MCC, VO: university.eosc-synergy.eu, command: keypair create --public-key ... +-------------+------------------------------------------------------------------+ | Field | Value | +-------------+------------------------------------------------------------------+ | created_at | None | | fingerprint | 28:90:22:86:f9:e9:9e:3c:da:83:66:4b:46:2c:0e:f1 | | id | KEY-NAME | | is_deleted | None | | name | KEY-NAME | | type | ssh | | user_id | 8400e4461ca57cead78f59dc4f0a5888ef2098006fc4d554af3a214d8896763c | +-------------+------------------------------------------------------------------+
To launch an instance, you must at least specify the flavor, image, network, key and instance name.
A flavor specifies a virtual resource allocation profile which includes processor, memory, and storage.
List available flavors:
$ fedcloud openstack --site CESNET-MCC --vo university.eosc-synergy.eu flavor list
Site: CESNET-MCC, VO: university.eosc-synergy.eu, command: flavor list
+--------------------------------------+----------------------+-------+------+-----------+-------+-----------+
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |
+--------------------------------------+----------------------+-------+------+-----------+-------+-----------+
| 4c153ce3-a163-4668-baa7-2cbcb57e2dd8 | standard.medium | 4096 | 80 | 0 | 2 | True |
...
| e7a3872a-cc28-48cc-9647-985acf5dce1d | standard.2core-16ram | 16384 | 80 | 0 | 2 | True |
+--------------------------------------+----------------------+-------+------+-----------+-------+-----------+
List available images:
$ fedcloud openstack --site CESNET-MCC --vo university.eosc-synergy.eu image list Site: CESNET-MCC, VO: university.eosc-synergy.eu, command: image list +--------------------------------------+---------------------------------------------+--------+ | ID | Name | Status | +--------------------------------------+---------------------------------------------+--------+ | 500c5f32-af40-476e-9720-2f55d5b94b8b | centos-7-x86_64 | active | ... | 97c8b617-2f82-4ba7-9e4a-4bb5e289acbb | windows-server-2019-standard-eval-x86_64 | active | +--------------------------------------+---------------------------------------------+--------+
$ fedcloud openstack --site CESNET-MCC --vo university.eosc-synergy.eu image show ubuntu-focal-x86_64 --json-output
{
"Site": "CESNET-MCC",
"VO": "university.eosc-synergy.eu",
"command": "image show ubuntu-focal-x86_64",
"Exception": null,
"Error code": 0,
"Result": {
"checksum": "3a7e3a547c209f712cb1351de39188d4",
"container_format": "bare",
"created_at": "2022-02-16T00:44:12Z",
"disk_format": "raw",
"file": "/v2/images/6b4b214f-4715-4284-bc56-712a8a72bbca/file",
"id": "6b4b214f-4715-4284-bc56-712a8a72bbca",
"min_disk": 3,
"min_ram": 1024,
"name": "ubuntu-focal-x86_64",
"owner": "fc4786e5eb244449b2d49d9a53095c49",
"properties": {
"os_hidden": false,
"os_hash_algo": "sha512",
"os_hash_value": "2c3f6775a4926ff254650e3287dae4a3f45162de4d90c151c2d0e7dd0e208cb28410f98072404eee7c582ba030968b25c3bc06a271f73c8a56421bfb988afa77",
"owner_specified.openstack.md5": "",
"owner_specified.openstack.sha256": "",
"owner_specified.openstack.object": "images/ubuntu-focal-x86_64-image-rotation-20220216T001436",
"default_user": "ubuntu",
"os_flavor": "Ubuntu",
"requires_rdp": "False",
"requires_ssh": "True",
"locations": [
{
"url": "rbd://c0ddaba3-ec1e-4e29-8f04-2325af25f8b0/prod-glance-images/6b4b214f-4715-4284-bc56-712a8a72bbca/snap",
"metadata": {}
}
],
"direct_url": "rbd://c0ddaba3-ec1e-4e29-8f04-2325af25f8b0/prod-glance-images/6b4b214f-4715-4284-bc56-712a8a72bbca/snap",
"os_distro": "ubuntu",
"os_version": "20.04.2",
"hw_disk_bus": "scsi",
"hw_rng_model": "virtio",
"hw_scsi_model": "virtio-scsi",
"os_type": "linux",
"hw_qemu_guest_agent": "yes",
"os_require_quiesce": true
},
"protected": false,
"schema": "/v2/schemas/image",
"size": 2361393152,
"status": "active",
"tags": [],
"updated_at": "2022-02-16T00:46:34Z",
"visibility": "public"
}
}
List available networks:
$ fedcloud openstack --site CESNET-MCC --vo university.eosc-synergy.eu network list Site: CESNET-MCC, VO: university.eosc-synergy.eu, command: network list +--------------------------------------+--------------------------------------+--------------------------------------+ | ID | Name | Subnets | +--------------------------------------+--------------------------------------+--------------------------------------+ | 03b21c24-910f-4ec5-a8f3-419db219b383 | 78-128-250-pers-proj-net | 8a073238-0857-41d3-809e-3c99af2bd1df |
... | ee46ba80-4b59-4778-b49a-35439279649d | group-project-network | d3b7268a-92e7-4e80-bbaf-5d5f40812449 | +--------------------------------------+--------------------------------------+--------------------------------------+
Launch the instance
Replace YOUR-KEY-NAME and YOUR-INSTANCE-NAME. You can also select a different flavor or image but keep the network name.
$ fedcloud openstack --site CESNET-MCC --vo university.eosc-synergy.eu \
server create \
--flavor standard.tiny \
--image ubuntu-focal-x86_64 \
--network group-project-network \
--key-name YOUR-KEY-NAME \
YOUR-INSTANCE-NAME
$ fedcloud openstack --site CESNET-MCC --vo university.eosc-synergy.eu \
server show YOUR-INSTANCE-NAME
Site: CESNET-MCC, VO: university.eosc-synergy.eu, command: server show YOUR-INSTANCE-NAME
+-----------------------------+------------------------------------------------------------------+
| Field | Value |
+-----------------------------+------------------------------------------------------------------+
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-AZ:availability_zone | brno1 |
| OS-EXT-STS:power_state | Running |
| OS-EXT-STS:task_state | None |
| OS-EXT-STS:vm_state | active |
| OS-SRV-USG:launched_at | 2022-03-30T11:17:58.000000 |
| OS-SRV-USG:terminated_at | None |
| accessIPv4 | |
| accessIPv6 | |
| addresses | group-project-network=192.168.0.35 |
| config_drive | |
| created | 2022-03-30T11:17:49Z |
| flavor | standard.tiny (6c329868-8337-4084-9971-6f58f8208221) |
| hostId | 75b97488c3cbca8abf418cf37aafa11b941f527b172f06d6c1e60f46 |
| id | fdd97def-94c3-4f37-9575-67c22b40e30a |
| image | ubuntu-focal-x86_64 (6b4b214f-4715-4284-bc56-712a8a72bbca) |
| key_name | YOUR-KEY-NAME |
| name | YOUR-INSTANCE-NAME |
| progress | 0 |
| project_id | a478488b79df46c4a086ecb7a321b038 |
| properties | |
| security_groups | name='default' |
| status | ACTIVE |
| updated | 2022-03-30T11:17:58Z |
| user_id | 8400e4461ca57cead78f59dc4f0a5888ef2098006fc4d554af3a214d8896763c |
| volumes_attached | |
+-----------------------------+------------------------------------------------------------------+
Floating IP
The instance has a private IP visible only in Openstack-internal network. To access your instance you need to allocate a floating IP address and assign it to your instance.
Creation of a floating IP:
$ fedcloud openstack --site CESNET-MCC --vo university.eosc-synergy.eu floating ip create public-muni-147-251-21-GROUPAssociation of a floating IP to an instance (replace INSTANCE-NAME and FLOATING-IP):
Site: CESNET-MCC, VO: university.eosc-synergy.eu, command: floating ip create public-muni-147-251-21-GROUP +---------------------+--------------------------------------+ | Field | Value | +---------------------+--------------------------------------+ | created_at | 2022-03-30T12:03:42Z | | description | | | dns_domain | None | | dns_name | None | | fixed_ip_address | None | | floating_ip_address | FLOATING-IP | | floating_network_id | 08b3fb96-6e2d-455b-8f9a-747da99689f2 | | id | c088b4c2-5ddc-41bf-9d92-9cab4afe91c7 | | name | FLOATING-IP | | port_details | None | | port_id | None | | project_id | a478488b79df46c4a086ecb7a321b038 | | qos_policy_id | None | | revision_number | 0 | | router_id | None | | status | DOWN | | subnet_id | None | | tags | [] | | updated_at | 2022-03-30T12:03:42Z | +---------------------+--------------------------------------+
$ fedcloud openstack --site CESNET-MCC --vo university.eosc-synergy.eu \
server add floating ip \
INSTANCE-NAME \
FLOATING-IP
List floating IPs and their associations:
$ fedcloud openstack --site CESNET-MCC --vo university.eosc-synergy.eu floating ip list
You should be able now to access your instance using an SSH connection to a floating IP address and the key pair associated with the instance (NOTE: the initial username is image-specific)
$ ssh ubuntu@FLOATING-IP