$ apt-get update $ apt-get install curl python-pip python-dev git libxml2-dev libxslt1-dev python-keystoneclient python-heatclient python-novaclient python-glanceclient python-neutronclient
$ pip install git+https://github.com/openstack/python-cinderclient $ pip install cliff --upgrade $ pip install python-openstackclient
$ source rc.sh
$ neutron net-list
+--------------------------------------+------------------+-----------------------------------------------------+ | id | name | subnets | +--------------------------------------+------------------+-----------------------------------------------------+ | 1c037362-487f-4103-a73b-6cba3f5532dc | nat | b7be542a-2eef-465e-aacd-34a0c83e6afa 192.168.0.0/24 | | ab2264dd-bde8-4a97-b0da-5fea63191019 | external-network | 102a9263-2d84-4335-acfb-6583ac8e70aa | | | | aa9e4fc4-63b0-432e-bcbd-82a613310acb | | fce90252-7d99-4fc7-80ae-ef763d12938d | newnetwork | 5a1a68f9-b885-47b7-9c7e-6f0e08145e3b 192.168.1.0/24 | +--------------------------------------+------------------+-----------------------------------------------------+
$ glance image-list
+--------------------------------------+--------------------------+-------------+------------------+-------------+--------+ | ID | Name | Disk Format | Container Format | Size | Status | +--------------------------------------+--------------------------+-------------+------------------+-------------+--------+ | 552bc246-5ae7-4b48-9a64-e1e881a64cab | CentOS 6 32-bit | raw | bare | 219152384 | active | | 708a7642-80ab-486e-a031-e6b6a652004c | CentOS 6 32-bit | raw | bare | 2147483648 | active | | 978d81c0-c508-412d-9847-fb8cec294410 | CentOS 6 64-bit | raw | bare | 263192576 | active | | ee5d5bb7-8a31-467a-8bbf-f6f5bbb79334 | CentOS 6 64-bit | raw | bare | 2147483648 | active | | 647bce00-5f29-49fe-9e83-8b33cb188d17 | CentOS 7 64-bit | raw | bare | 2147483648 | active | | dff9df74-b7b3-44b0-92f3-40cb4dfd9a94 | CoreOS | qcow2 | ovf | 449839104 | active | | 3eda89b9-9ce0-47b7-9907-a2978d88632e | CoreOS | qcow2 | ovf | 413007872 | active | | d2033c50-e8f4-4ff6-9c21-cade02007f34 | Debian 7 (Wheezy) 32-bit | raw | bare | 10485760 | active | | ba78ce9b-f800-4fb2-ad85-a68ca0f19cb8 | Debian 7 (Wheezy) 32-bit | raw | bare | 2147483648 | active | | b2c8bc6a-dbb8-4a1a-ab8e-c63f5f2b9bdf | Debian 7 (Wheezy) 64-bit | raw | bare | 11534336 | active | | 18a18569-389c-4144-82ae-e5e85862fca4 | Debian 7 (Wheezy) 64-bit | raw | bare | 2147483648 | active | | 8c3233c9-25cd-4181-a422-aa24032255cc | OpenSUSE 13.1 32-bit | raw | bare | 74448896 | active | | d965d37c-6796-40bd-8966-d0d7f7f41313 | OpenSUSE 13.1 32-bit | raw | bare | 3221225472 | active | | b77015d0-3eba-4841-9d02-7e9d606d343a | OpenSUSE 13.1 64-bit | raw | bare | 76546048 | active | | b20a1e1a-3c81-4d13-926f-eb39546b9b36 | OpenSUSE 13.1 64-bit | raw | bare | 3221225472 | active | | c168e0e5-c01e-44ec-be36-1c10e2da94a5 | selectel-rescue-initrd | ari | ari | 13665966 | active | | 0b117761-4ab5-40d7-a610-127d1e10206f | selectel-rescue-kernel | aki | aki | 5634192 | active | | c2fce974-4aeb-473a-9475-176207c3f293 | Ubuntu 12.04 LTS 32-bit | raw | bare | 22020096 | active | | eeb9143c-1500-4086-8025-307bc96fc467 | Ubuntu 12.04 LTS 32-bit | raw | bare | 2147483648 | active | | dbdd5cb3-f73f-4d98-85e9-eb333463e431 | Ubuntu 12.04 LTS 64-bit | raw | bare | 26214400 | active | | c1231800-9423-4018-b138-af8860ea8239 | Ubuntu 12.04 LTS 64-bit | raw | bare | 2147483648 | active | | c61cfa0d-3f7b-489f-8e55-4904a0d6e830 | Ubuntu 14.04 LTS 32-bit | raw | bare | 26214400 | active | | fbb2bb25-5058-4f06-85c8-6d3ca268e686 | Ubuntu 14.04 LTS 32-bit | raw | bare | 2147483648 | active | | e024042b-80f5-4eea-ae29-733ae32f65e6 | Ubuntu 14.04 LTS 64-bit | raw | bare | 33554432 | active | | f10ab2a9-478d-4401-9371-384bd9731156 | Ubuntu 14.04 LTS 64-bit | raw | bare | 2147483648 | active | | 6a4b53e6-109c-4fc0-9535-b97bc2912de6 | windows_2012_final | raw | bare | 10737418240 | active | +--------------------------------------+--------------------------+-------------+------------------+-------------+--------+
$ nova flavor-create < > auto < > < > < >
+------------------------------------+------+---------+----+---------+----+-----+-----------+---------+ |ID |Name |Memory,MB|Disk|Ephemeral|Swap|VCPUs|RXTX_Factor|Is_Public| +------------------------------------+------+---------+----+---------+----+-----+-----------+---------+ |fc275dcc-f51a-48c3-b0c3-c3fdd300dd65|myflvr| 1024 | 0 | 0 | | 2 | 1.0 | True | +------------------------------------+------+---------+----+---------+----+-----+-----------+---------+
$ nova keypair-add < > < > $ chmod 600
$ nova keypair-add < > pub-key < >
$ nova keypair-add myKey --pub-key /home/user/.ssh/id_rsa.pub
$ nova boot < > <flavor_id> --nic net-id=<id > --key-name myKey --block-device id=<image_id>,source=image,dest=volume,size=0,device=vda,bootindex=0
$ cinder create --name < > <, >
+-------------------+--------------------------------------+ | Property | Value | +-------------------+--------------------------------------+ | attachments | [] | | availability_zone | ru-1a | | bootable | false | | created_at | 2014-10-23T11:10:15.000000 | | description | None | | encrypted | False | | id | 76586803-9cfd-4f75-931d-0a4dee98e496 | | metadata | {} | | name | mydisk | | size | 5 | | snapshot_id | None | | source_volid | None | | status | creating | | user_id | 6f862e43d4a84f359928948fb658d695 | | volume_type | default | +-------------------+--------------------------------------+
$ nova volume-attach < > <id >
$ neutron floatingip-create external-network
$ nova floating-ip-associate < > <>
$ nova reboot < >
$ nova reboot --hard < >
# $ nova start < > # $ nova stop < >
$ neutron net-create < >
+----------------+--------------------------------------+ | Field | Value | +----------------+--------------------------------------+ | admin_state_up | True | | id | add73ca5-6120-43bd-bb56-d1d8d71d21ac | | name | localnet | | shared | False | | status | ACTIVE | | subnets | | | tenant_id | d15391cc95474b1ab6bd81fb2a73bc5c | +----------------+--------------------------------------+
$ neutron subnet-create --name 192.168.1.0/24 192.168.1.0/24 <id >
$ neutron port-create < >
$ nova interface-attach --port-id <id > < >
Source: https://habr.com/ru/post/242001/
All Articles