github.com/mhilton/juju-juju@v0.0.0-20150901100907-a94dd2c73455/cmd/juju/helptopics/constraints.go (about)

     1  // Copyright 2015 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package helptopics
     5  
     6  const Constraints = `
     7  Constraints constrain the possible instances that may be started by juju
     8  commands. They are usually passed as a flag to commands that provision a new
     9  machine (such as bootstrap, deploy, and add-machine).
    10  
    11  Each constraint defines a minimum acceptable value for a characteristic of a
    12  machine.  Juju will provision the least expensive machine that fulfills all the
    13  constraints specified.  Note that these values are the minimum, and the actual
    14  machine used may exceed these specifications if one that exactly matches does
    15  not exist.
    16  
    17  If a constraint is defined that cannot be fulfilled by any machine in the
    18  environment, no machine will be provisioned, and an error will be printed in the
    19  machine's entry in juju status.
    20  
    21  Constraint defaults can be set on an environment or on specific services by
    22  using the set-constraints command (see juju help set-constraints).  Constraints
    23  set on the environment or on a service can be viewed by using the get-
    24  constraints command.  In addition, you can specify constraints when executing a
    25  command by using the --constraints flag (for commands that support it).
    26  
    27  Constraints specified on the environment and service will be combined to
    28  determine the full list of constraints on the machine(s) to be provisioned by
    29  the command.  Service-specific constraints will override environment-specific
    30  constraints, which override the juju default constraints.
    31  
    32  Constraints are specified as key value pairs separated by an equals sign, with
    33  multiple constraints delimited by a space.
    34  
    35  Constraint Types:
    36  
    37  arch
    38     Arch defines the CPU architecture that the machine must have.  Currently
    39     recognized architectures:
    40        amd64 (default)
    41        i386
    42        arm
    43  
    44  cpu-cores
    45     Cpu-cores is a whole number that defines the number of effective cores the
    46     machine must have available.
    47  
    48  mem
    49     Mem is a float with an optional suffix that defines the minimum amount of RAM
    50     that the machine must have.  The value is rounded up to the next whole
    51     megabyte.  The default units are megabytes, but you can use a size suffix to
    52     use other units:
    53  
    54        M megabytes (default)
    55        G gigabytes (1024 megabytes)
    56        T terabytes (1024 gigabytes)
    57        P petabytes (1024 terabytes)
    58  
    59  root-disk
    60     Root-Disk is a float that defines the amount of space in megabytes that must
    61     be available in the machine's root partition.  For providers that have
    62     configurable root disk sizes (such as EC2) an instance with the specified
    63     amount of disk space in the root partition may be requested.  Root disk size
    64     defaults to megabytes and may be specified in the same manner as the mem
    65     constraint.
    66  
    67  container
    68     Container defines that the machine must be a container of the specified type.
    69     A container of that type may be created by juju to fulfill the request.
    70     Currently supported containers:
    71        none - (default) no container
    72        lxc - an lxc container
    73        kvm - a kvm container
    74  
    75  cpu-power
    76     Cpu-power is a whole number that defines the speed of the machine's CPU,
    77     where 100 CpuPower is considered to be equivalent to 1 Amazon ECU (or,
    78     roughly, a single 2007-era Xeon).  Cpu-power is currently only supported by
    79     the Amazon EC2 environment.
    80  
    81  tags
    82     Tags defines the list of tags that the machine must have applied to it.
    83     Multiple tags must be delimited by a comma. Both positive and negative
    84     tags constraints are supported, the latter have a "^" prefix. Tags are
    85     currently only supported by the MaaS environment.
    86  
    87  networks
    88     Networks defines the list of networks to ensure are available or not on the
    89     machine. Both positive and negative network constraints can be specified, the
    90     later have a "^" prefix to the name. Multiple networks must be delimited by a
    91     comma. Not supported on all providers. Example: networks=storage,db,^logging
    92     specifies to select machines with "storage" and "db" networks but not "logging"
    93     network. Positive network constraints do not imply the networks will be enabled,
    94     use the --networks argument for that, just that they could be enabled.
    95  
    96  instance-type
    97     Instance-type is the provider-specific name of a type of machine to deploy,
    98     for example m1.small on EC2 or A4 on Azure.  Specifying this constraint may
    99     conflict with other constraints depending on the provider (since the instance
   100     type my determine things like memory size etc.)
   101  
   102  Example:
   103  
   104     juju add-machine --constraints "arch=amd64 mem=8G tags=foo,^bar"
   105  
   106  See Also:
   107     juju help set-constraints
   108     juju help get-constraints
   109     juju help deploy
   110     juju help add-unit
   111     juju help add-machine
   112     juju help bootstrap
   113  `