Articles

OVH Public Cloud: moving instances, adding disks and swapping the gateway

· 1 min readovhlinuxsoftdevel

Moving instances with the OpenStack client

Create an OpenStack user

  1. Public Cloud > select project > Settings > Users & Roles
  2. Create a user
  3. Reset the password
  4. 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:

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:

  1. Network > Gateway
  2. 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.

All articles

See also

linuxsoftdevel

Linux server administration: a practical cheatsheet

Security checks, certificates, scheduled jobs, disks and backups, network diagnostics and basic system configuration — commands I use on Linux servers.

linuxzshmcsoftdevel

Linux desktop and shell tips: Fedora, zsh, Midnight Commander, KVM

Numpad decimal separator, PackageKit cache, Firefox fonts, SD card backup, KVM snapshots, bulk image resizing, hostname in the zsh prompt and Midnight Commander settings.

softdevelPL

Notuj swobodnie, niech AI zadba o resztę

Od zawsze, im więcej notowałem, tym mniej użyteczny stawał się mój notes, czy to papierowy, czy elektroniczny.