Skip to content

Latest commit

 

History

History
78 lines (53 loc) · 1.63 KB

vultr.md

File metadata and controls

78 lines (53 loc) · 1.63 KB

Vultr setup

Login into the Vultr Data Portal.

Create an API secret

Click on your username and select API/Enable API. Copy the API Key somewhere. And in the Access Control section Add Any IPv4 as allowed subnets.

Remember to disable the API when finished and to remove subnets too

Generate ssh key and add to the portal

Generate an ssh key:

if [ ! -f ~/.ssh/id_nsdf ] ; then
  ssh-keygen -t rsa -f ~/.ssh/id_nsdf -N ""
fi

Go to the Vulr Manage SSH keys and add your id_nsdf.pub key:

  • Name: id_nsdf

  • Content: copy the id_nsdf.pub content here

Update your vault file

Add one item to your ~/.nsdf/vault/vault.yml file (change values as needed; for example you may need to change the api-key):

ec2-vultr:
  class: VultrEc2
  api-key: XXXXX
  num: 1
  VPSPLANID: 201  # this plan is '1024 MB RAM,25 GB SSD,1.00 TB BW'
  OSID: 387 # this is Ubuntu 20.04 x64 
  region: New Jersey
  ssh-username: root
  ssh-key-filename: ~/.ssh/id_nsdf
  ssh-key-name: id_nsdf

Examples

Create new nodes`:

alias nsdf-cloud="python3 -m nsdf-cloud"

ACCOUNT=ec2-vultr
nsdf-cloud $ACCOUNT create nodes test1 --num 1 

List of nodes:

nsdf-cloud $ACCOUNT get nodes test1 

Delete nodes:

nsdf-cloud $ACCOUNT delete nodes test1 

Other useful commands:

# if you want to change the VM (i.e. VPSPLANID)
nsdf-cloud $ACCOUNT get plans

# if you want to change the OS
nsdf-cloud $ACCOUNT get os

# if you want to change the region
nsdf-cloud $ACCOUNT get regions