The ProfitBricks SaltStack cloud module allows a ProfitBricks server to be automatically deployed and bootstraped with Salt.
profitbrick >= 3.1.0
The module requires ProfitBricks credentials to be supplied along with an existing virtual datacenter UUID where the server resources will reside. The server should also be assigned a public LAN, a private LAN, or both along with SSH key pairs. ...
Set up the cloud configuration at /etc/salt/cloud.providers
or
/etc/salt/cloud.providers.d/profitbricks.conf
:
my-profitbricks-config:
driver: profitbricks
# The ProfitBricks login username
username: user@example.com
# The ProfitBricks login password
password: secretpassword
# The ProfitBricks virtual datacenter UUID
datacenter_id: <UUID>
# SSH private key filename
ssh_private_key: /path/to/private.key
# SSH public key filename
ssh_public_key: /path/to/public.key
my-profitbricks-profile:
provider: my-profitbricks-config
# Name of a predefined server size.
size: Micro Instance
# Assign CPU family to server.
cpu_family: INTEL_XEON
# Number of CPU cores to allocate to node (overrides server size).
cores: 4
# Amount of RAM in multiples of 256 MB (overrides server size).
ram: 4096
# The server availability zone.
availability_zone: ZONE_1
# Name or UUID of the HDD image to use.
image: <UUID>
# Image alias could be provided instead of image.
# Example 'ubuntu:latest'
#image_alias: <IMAGE_ALIAS>
# Size of the node disk in GB (overrides server size).
disk_size: 40
# Type of disk (HDD or SSD).
disk_type: SSD
# Storage availability zone to use.
disk_availability_zone: ZONE_2
# Assign the server to the specified public LAN.
public_lan: <ID>
# Assign firewall rules to the network interface.
public_firewall_rules:
SSH:
protocol: TCP
port_range_start: 22
port_range_end: 22
# Assign the server to the specified private LAN.
private_lan: <ID>
# Enable NAT on the private NIC.
nat: true
# Assign additional volumes to the server.
volumes:
data-volume:
disk_size: 500
disk_availability_zone: ZONE_3
log-volume:
disk_size: 50
disk_type: SSD
To use a private IP for connecting and bootstrapping node:
my-profitbricks-profile:
ssh_interface: private_lan
Set deploy
to False if Salt should not be installed on the node.
my-profitbricks-profile:
deploy: False
Return a list of the images that are on the provider
Return a dict of all available VM locations on the cloud provider with relevant data
Return a dict of all available VM sizes on the cloud provider with relevant data. Latest version can be found at:
Create a single VM from a data dict
Creates a virtual datacenter based on supplied parameters.
CLI Example:
salt-cloud -f create_datacenter profitbricks name=mydatacenter
location=us/las description="my description"
Creates a loadbalancer within the datacenter from the provider config.
CLI Example:
salt-cloud -f create_loadbalancer profitbricks name=mylb
destroy a machine by name
name -- name given to the machine
call -- call value in this case is 'action'
array of booleans , true if successfully stopped and true if successfully removed
CLI Example:
salt-cloud -d vm_name
Return the first configured instance.
Return a conn object for the passed VM data
Return the datacenter from the config provider datacenter ID
Return datacenter ID from provider configuration
Warn if dependencies are not met.
Return the type of disk to use. Either 'HDD' (default) or 'SSD'.
Return the image object to use
Check SSH private key file and return absolute path if exists.
Return a node for the named VM
Retrieve list of SSH public keys.
Return the VM's size object
Return the wait_for_timeout for resource provisioning.
List all the data centers
CLI Example:
salt-cloud -f list_datacenters my-profitbricks-config
List all the images with alias by location
CLI Example:
salt-cloud -f list_images my-profitbricks-config location=us/las
Return a list of the loadbalancers that are on the provider
Return a list of VMs that are on the provider
Return a list of the VMs that are on the provider, with all fields
reboot a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful
CLI Example:
salt-cloud -a reboot vm_name
Reserve the IP Block
Enables public Internet access for the specified public_lan. If no public LAN is available, then a new public LAN is created.
Show the details from the provider concerning an instance
Return the ssh_interface type to connect to. Either 'public_ips' (default) or 'private_ips'.
start a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful
CLI Example:
salt-cloud -a start vm_name
stop a machine by name :param name: name given to the machine :param call: call value in this case is 'action' :return: true if successful
CLI Example:
salt-cloud -a stop vm_name
Checks profitbricks version