jph00 / notes

Stuff I find (see issues)
Creative Commons Attribution Share Alike 4.0 International
38 stars 1 forks source link

Openstack (e.g. DreamCompute) #2

Open jph00 opened 3 years ago

jph00 commented 3 years ago

Install

pip install python-openstackclient 

Show setup info

openstack flavor list
openstack image list --status active
openstack keypair list         

Dreamhost flavors

ID Name RAM
50 gp1.semisonic 512
100 gp1.subsonic 1024
200 gp1.supersonic 2048
300 gp1.lightspeed 4096
400 gp1.warpspeed 8192
500 gp1.hyperspeed 16384

Import ssh key

openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey

Create instance

openstack server create --flavor gp1.semisonic --image Ubuntu-20.04 --key-name mykey myinstance 

# Get IP address
IP=$(openstack server show -c addresses -f value myinstance | cut -f 2 -d ' ')

# Connect
ssh ubuntu@$IP

Reboot

openstack server reboot myinstance