miroir de
https://github.com/PAPAMICA/Wiki-Tech.io.git
synchronisé 2024-11-07 10:10:26 +01:00
121 lignes
21 Kio
HTML
121 lignes
21 Kio
HTML
<!--
|
|
title: Guide rapide
|
|
description:
|
|
published: true
|
|
date: 2021-04-29T11:19:46.694Z
|
|
tags:
|
|
editor: ckeditor
|
|
dateCreated: 2021-04-29T11:19:46.694Z
|
|
-->
|
|
|
|
<h2>Create a keypair</h2>
|
|
<p>A keypair is basically a ssh key allowing you to login to your virtual machine</p>
|
|
<p>Keypair options Keypairs provide the method to authenticate when logging into a Linux VM. There are several options for how to create them.</p>
|
|
<ol>
|
|
<li>Using your existing SSH key</li>
|
|
</ol>
|
|
<p>Assuming your existing ssh public key is located at <code>~/.ssh/ssh_my_rsa_key.pub</code></p>
|
|
<p>Import it using the following command:</p>
|
|
<p><code>ochaze@ochaze:~$ openstack keypair create --public-key ~/.ssh/ssh_my_rsa_key.pub mykeypair
|
|
+-------------+-------------------------------------------------+
|
|
| Field | Value |
|
|
+-------------+-------------------------------------------------+
|
|
| fingerprint | 53:c0:03:5f:27:6f:c2:66:b4:e4:f3:26:e0:f8:82:4a |
|
|
| name | mykeypair |
|
|
| user_id | b1580497f51e4d10b9110c60c154562c |
|
|
+-------------+-------------------------------------------------+
|
|
</code></p>
|
|
<p>If you don't know how to create a ssh key refer to <a href="https://docs.infomaniak.cloud/user-guide/0009.keypairs/">this guide</a></p>
|
|
<h3>Choose a flavor</h3>
|
|
<p><code>ochaze@ochaze:~$ openstack flavor list
|
|
+--------------------------------------+------------------+------+------+-----------+-------+-----------+
|
|
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |
|
|
+--------------------------------------+------------------+------+------+-----------+-------+-----------+
|
|
| 23c60b2b-6a1a-4870-ba41-ab1d6ce0c516 | cpu1-ram2-disk10 | 2048 | 10 | 0 | 1 | True |
|
|
| 2655c1e3-a43a-4dea-a957-650517e8fa72 | cpu2-ram6-disk20 | 6144 | 20 | 0 | 2 | True |
|
|
| 450314a4-3575-45d5-88c2-41ca78201ebe | cpu2-ram6-disk60 | 6144 | 60 | 0 | 2 | True |
|
|
| ef91c4c8-c28f-44b0-b7a0-3115652b52d1 | cpu2-ram6-disk40 | 6144 | 40 | 0 | 2 | True |
|
|
| f2c62dc0-4b83-4208-868a-fbc4dbc2ff3a | cpu1-ram2-disk20 | 2048 | 20 | 0 | 1 | True |
|
|
+--------------------------------------+------------------+------+------+-----------+-------+-----------+
|
|
</code></p>
|
|
<h3>Choos an image (Operating System)</h3>
|
|
<p><code>ochaze@ochaze:~$ openstack image list
|
|
+--------------------------------------+-----------------------------------------------+--------+
|
|
| ID | Name | Status |
|
|
+--------------------------------------+-----------------------------------------------+--------+
|
|
| 097480e6-16bc-4a50-a7af-e34399d039ac | cirros-0.3.4 | active |
|
|
| 77ce9a1a-4c03-43d7-9f87-b447a39103bb | debian-10-genericcloud-amd64-20210208-542.raw | active |
|
|
| 735a5c16-56f0-4c15-80e7-49056dbc4f71 | debian-10.7.4-20210108-openstack-amd64.raw | active |
|
|
| 49f425ed-bf79-46ab-8cf3-44935d9d831e | debian-10.8.0-openstack-amd64.raw | active |
|
|
| daf43e02-f59e-45bb-8d63-436094d3f360 | debian-buster-202102191137-amd64.raw | active |
|
|
+--------------------------------------+-----------------------------------------------+--------+
|
|
</code></p>
|
|
<h3>Create your VM</h3>
|
|
<p><code>ochaze@ochaze:~$ openstack server create --image debian-10.8-openstack-amd64.raw --flavor cpu2-ram6-disk20 --key-name mykeypair --network ext-net1 infomaniak-vm-1
|
|
+-----------------------------+------------------------------------------------------------------------+
|
|
| Field | Value |
|
|
+-----------------------------+------------------------------------------------------------------------+
|
|
| OS-DCF:diskConfig | MANUAL |
|
|
| OS-EXT-AZ:availability_zone | |
|
|
| OS-EXT-STS:power_state | NOSTATE |
|
|
| OS-EXT-STS:task_state | scheduling |
|
|
| OS-EXT-STS:vm_state | building |
|
|
| OS-SRV-USG:launched_at | None |
|
|
| OS-SRV-USG:terminated_at | None |
|
|
| accessIPv4 | |
|
|
| accessIPv6 | |
|
|
| addresses | |
|
|
| adminPass | mii5bBNRGRF6 |
|
|
| config_drive | |
|
|
| created | 2021-02-24T15:51:17Z |
|
|
| flavor | cpu2-ram6-disk20 (2655c1e3-a43a-4dea-a957-650517e8fa72) |
|
|
| hostId | |
|
|
| id | 5bf0ebf6-825d-4879-b4b8-90245ec4dc19 |
|
|
| image | debian-10.8-openstack-amd64.raw (0c857837-f852-44dc-b986-bcc488bf7b70) |
|
|
| key_name | mykeypair |
|
|
| name | infomaniak-vm-1 |
|
|
| progress | 0 |
|
|
| project_id | ac4fafd60021431585bbb23470119557 |
|
|
| properties | |
|
|
| security_groups | name='default' |
|
|
| status | BUILD |
|
|
| updated | 2021-02-24T15:51:17Z |
|
|
| user_id | b1580497f51e4d10b9110c60c154562c |
|
|
| volumes_attached | |
|
|
+-----------------------------+------------------------------------------------------------------------+
|
|
</code></p>
|
|
<h3>Check your VM is active</h3>
|
|
<p><code>ochaze@ochaze:~$ openstack server show infomaniak-vm-1
|
|
+-----------------------------+------------------------------------------------------------------------+
|
|
| Field | Value |
|
|
+-----------------------------+------------------------------------------------------------------------+
|
|
| OS-DCF:diskConfig | MANUAL |
|
|
| OS-EXT-AZ:availability_zone | b10 |
|
|
| OS-EXT-STS:power_state | Running |
|
|
| OS-EXT-STS:task_state | None |
|
|
| OS-EXT-STS:vm_state | active |
|
|
| OS-SRV-USG:launched_at | 2021-02-24T15:51:27.000000 |
|
|
| OS-SRV-USG:terminated_at | None |
|
|
| accessIPv4 | |
|
|
| accessIPv6 | |
|
|
| addresses | ext-net1=2001:1600:115:1::3d8, 195.15.241.27 |
|
|
| config_drive | |
|
|
| created | 2021-02-24T15:51:17Z |
|
|
| flavor | cpu2-ram6-disk20 (2655c1e3-a43a-4dea-a957-650517e8fa72) |
|
|
| hostId | 1baedae8de146b81f259cfec3cf33fcae980bb274f8fef46a5f49ba9 |
|
|
| id | 5bf0ebf6-825d-4879-b4b8-90245ec4dc19 |
|
|
| image | debian-10.8-openstack-amd64.raw (0c857837-f852-44dc-b986-bcc488bf7b70) |
|
|
| key_name | mykeypair |
|
|
| name | infomaniak-vm-1 |
|
|
| progress | 0 |
|
|
| project_id | ac4fafd60021431585bbb23470119557 |
|
|
| properties | |
|
|
| security_groups | name='default' |
|
|
| status | ACTIVE |
|
|
| updated | 2021-02-24T15:51:27Z |
|
|
| user_id | b1580497f51e4d10b9110c60c154562c |
|
|
| volumes_attached | |
|
|
+-----------------------------+------------------------------------------------------------------------+
|
|
</code></p>
|
|
<h3>SSH your Virtual Machine</h3>
|
|
<p><code>ssh debian@195.15.241.27</code></p>
|