Documentation

profitbricks - Create, destroy, start, stop, and reboot a ProfitBricks virtual machine.

New in version 2.0.

Synopsis

Create, destroy, update, start, stop, and reboot a ProfitBricks virtual machine. When the virtual machine is created it can optionally wait for it to be ‘running’ before returning. This module has a dependency on profitbricks >= 1.0.0

Requirements (on host that executes module)

  • profitbricks
  • python >= 2.6

Options

parameter required default choices comments
assign_public_ip
no
    This will assign the machine to the public LAN. If no LAN exists with public Internet access it is created.
    auto_increment
    no True
    • yes
    • no
    Whether or not to increment a single number in the name for created virtual machines.
    bus
    no VIRTIO
    • IDE
    • VIRTIO
    The bus type for the volume.
    cores
    no 2
      The number of CPU cores to allocate to the virtual machine.
      count
      no 1
        The number of virtual machines to create.
        datacenter
        no
          The Datacenter to provision this virtual machine.
          image
          yes
            The system image ID for creating the virtual machine, e.g. a3eae284-a2fe-11e4-b187-5f1f641608c8.
            instance_ids
            no
              list of instance ids, currently only used when state='absent' to remove instances.
              lan
              no 1
                The ID of the LAN you wish to add the servers to.
                location
                no us/las
                • us/las
                • us/lasdev
                • de/fra
                • de/fkb
                The datacenter location. Use only if you want to create the Datacenter or else this value is ignored.
                name
                yes
                  The name of the virtual machine.
                  ram
                  no 2048
                    The amount of memory to allocate to the virtual machine.
                    remove_boot_volume
                    no yes
                    • yes
                    • no
                    remove the bootVolume of the virtual machine you're destroying.
                    state
                    no present
                    • running
                    • stopped
                    • absent
                    • present
                    create or terminate instances
                    subscription_password
                    no
                      THe ProfitBricks password. Overrides the PB_PASSWORD environement variable.
                      subscription_user
                      no
                        The ProfitBricks username. Overrides the PB_SUBSCRIPTION_ID environement variable.
                        volume_size
                        no 10
                          The size in GB of the boot volume.
                          wait
                          no yes
                          • yes
                          • no
                          wait for the instance to be in state 'running' before returning
                          wait_timeout
                          no 600
                            how long before wait gives up, in seconds

                            Examples

                            # Note: These examples do not set authentication details, see the AWS Guide for details.
                            
                            # Provisioning example. This will create three servers and enumerate their names.
                            
                            - profitbricks:
                                datacenter: Tardis One
                                name: web%02d.stackpointcloud.com
                                cores: 4
                                ram: 2048
                                volume_size: 50
                                image: a3eae284-a2fe-11e4-b187-5f1f641608c8
                                location: us/las
                                count: 3
                                assign_public_ip: true
                            
                            # Removing Virtual machines
                            
                            - profitbricks:
                                datacenter: Tardis One
                                instance_ids:
                                  - 'web001.stackpointcloud.com'
                                  - 'web002.stackpointcloud.com'
                                  - 'web003.stackpointcloud.com'
                                wait_timeout: 500
                                state: absent
                            
                            # Starting Virtual Machines.
                            
                            - profitbricks:
                                datacenter: Tardis One
                                instance_ids:
                                  - 'web001.stackpointcloud.com'
                                  - 'web002.stackpointcloud.com'
                                  - 'web003.stackpointcloud.com'
                                wait_timeout: 500
                                state: running
                            
                            # Stopping Virtual Machines
                            
                            - profitbricks:
                                datacenter: Tardis One
                                instance_ids:
                                  - 'web001.stackpointcloud.com'
                                  - 'web002.stackpointcloud.com'
                                  - 'web003.stackpointcloud.com'
                                wait_timeout: 500
                                state: stopped
                            

                            This is an Extras Module

                            For more information on what this means please read Extras Modules

                            For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.