Moving instances with the OpenStack client
Create an OpenStack user
- Public Cloud > select project > Settings > Users & Roles
- Create a user
- Reset the password
- Download the OpenStack RC file
Set up your machine
brew install openstackclient
mv openrc.sh ~/bin/ovh-my-project-openrc.sh
source ~/bin/ovh-my-project-openrc.sh
openstack server list
Running openstack without arguments opens the client shell, so you don’t have to type openstack before every command.
Useful commands
openstack server list
openstack image list
# create an image from an instance
openstack server image create --name IMAGE_NAME SERVER_NAME
# download the image to the local machine
openstack image save --file snap_server1.qcow IMAGE_ID
# upload an image from the local machine
openstack image create --disk-format qcow2 --container-format bare --file snap_server1.qcow snap_server1
# create an instance from the image
openstack server create --key-name SSHKEY --flavor FLAVOR_ID --image IMAGE_ID Server1_from_snap
OVH documentation:
- Set OpenStack environment variables
- Przygotowanie środowiska dla API OpenStack
- Przenoszenie kopii zapasowych pomiędzy centrami danych
Adding a new disk
In the panel: Storage > Block Storage > Create new instance, then attach it to the server from the context menu.
On the server:
lsblk
fdisk /dev/vdb # n -> default answers, w
mkfs.ext4 /dev/vdb1
mkdir /mnt/disc1
# mount permanently
blkid # get the UUID
vim /etc/fstab
mount -a
OVH documentation: Utworzenie i konfiguracja dodatkowego dysku dla instancji
Swapping the gateway when your IP is blacklisted
If external servers block access from your IP, one solution is to replace the gateway of the private network through which the machines access the internet:
- Network > Gateway
- Remove the existing gateway and create a new one.
Private addresses of the machines obtained by DHCP should not change.
After this operation, Floating IPs pointing to instances in the network may stop working, even though everything looks fine in the OVH panel. In that case, open the Horizon panel, detach the Floating IP from the instance and assign it again.
