github.com/altoros/juju-vmware@v0.0.0-20150312064031-f19ae857ccca/cmd/juju/help_topics.go (about) 1 // Copyright 2013 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package main 5 6 const helpBasics = ` 7 Juju -- devops distilled 8 https://juju.ubuntu.com/ 9 10 Juju provides easy, intelligent service orchestration on top of environments 11 such as Amazon EC2, HP Cloud, OpenStack, MaaS, or your own local machine. 12 13 Basic commands: 14 juju init generate boilerplate configuration for juju environments 15 juju bootstrap start up an environment from scratch 16 17 juju deploy deploy a new service 18 juju add-relation add a relation between two services 19 juju expose expose a service 20 21 juju help bootstrap more help on e.g. bootstrap command 22 juju help commands list all commands 23 juju help glossary glossary of terms 24 juju help topics list all help topics 25 26 Provider information: 27 juju help azure-provider use on Windows Azure 28 juju help ec2-provider use on Amazon EC2 29 juju help hpcloud-provider use on HP Cloud 30 juju help local-provider use on this computer 31 juju help openstack-provider use on OpenStack 32 ` 33 34 const helpProviderStart = ` 35 Start by generating a generic configuration file for Juju, using the command: 36 37 juju init 38 39 This will create the '~/.juju/' directory (or $JUJU_HOME, if set) if it doesn't 40 already exist and generate a file, 'environments.yaml' in that directory. 41 ` 42 const helpProviderEnd = ` 43 See Also: 44 45 juju help init 46 juju help bootstrap 47 48 ` 49 50 const helpLocalProvider = ` 51 The local provider is a Linux-only Juju environment that uses LXC containers as 52 a virtual cloud on the local machine. Because of this, lxc and mongodb are 53 required for the local provider to work. All of these dependencies are tracked 54 in the 'juju-local' package. You can install that with: 55 56 sudo apt-get update 57 sudo apt-get install juju-local 58 59 After that you might get error for SSH authorised/public key not found. ERROR 60 SSH authorised/public key not found. 61 62 ssh-keygen -t rsa 63 64 Now you need to tell Juju to use the local provider and then bootstrap: 65 66 juju switch local 67 juju bootstrap 68 69 The first time this runs it might take a bit, as it's doing a netinstall for 70 the container, it's around a 300 megabyte download. Subsequent bootstraps 71 should be much quicker. You'll be asked for your 'sudo' password, which is 72 needed because only root can create LXC containers. When you need to destroy 73 the environment, do 'juju destroy-environment local' and you could be asked 74 for your 'sudo' password again. 75 76 You deploy charms from the charm store using the following commands: 77 78 juju deploy mysql 79 juju deploy wordpress 80 juju add-relation wordpress mysql 81 82 For Ubuntu deployments, the local provider will prefer to use lxc-clone to create 83 the machines for the trusty OS series and later. 84 A 'template' container is created with the name 85 juju-<series>-template 86 where <series> is the OS series, for example 'juju-trusty-template'. 87 You can override the use of clone by specifying 88 lxc-clone: true 89 or 90 lxc-clone: false 91 in the configuration for your local provider. If you have the main container 92 directory mounted on a btrfs partition, then the clone will be using btrfs 93 snapshots to create the containers. This means that clones use up much 94 less disk space. If you do not have btrfs, lxc will attempt to use aufs 95 (an overlay type filesystem). You can explicitly ask Juju to create 96 full containers and not overlays by specifying the following in the provider 97 configuration: 98 lxc-clone-aufs: false 99 100 101 References: 102 103 http://askubuntu.com/questions/65359/how-do-i-configure-juju-for-local-usage 104 https://juju.ubuntu.com/docs/getting-started.html 105 ` 106 107 const helpOpenstackProvider = ` 108 Here's an example OpenStack configuration: 109 110 sample_openstack: 111 type: openstack 112 113 # Specifies whether the use of a floating IP address is required to 114 # give the nodes a public IP address. Some installations assign public 115 # IP addresses by default without requiring a floating IP address. 116 # use-floating-ip: false 117 118 # Specifies whether new machine instances should have the "default" 119 # Openstack security group assigned. 120 # use-default-secgroup: false 121 122 # Usually set via the env variable OS_AUTH_URL, but can be specified here 123 # auth-url: https://yourkeystoneurl:443/v2.0/ 124 125 # The following are used for userpass authentication (the default) 126 # auth-mode: userpass 127 128 # Usually set via the env variable OS_USERNAME, but can be specified here 129 # username: <your username> 130 131 # Usually set via the env variable OS_PASSWORD, but can be specified here 132 # password: <secret> 133 134 # Usually set via the env variable OS_TENANT_NAME, but can be specified here 135 # tenant-name: <your tenant name> 136 137 # Usually set via the env variable OS_REGION_NAME, but can be specified here 138 # region: <your region> 139 140 If you have set the described OS_* environment variables, you only need "type:". 141 References: 142 143 http://juju.ubuntu.com/docs/provider-configuration-openstack.html 144 http://askubuntu.com/questions/132411/how-can-i-configure-juju-for-deployment-on-openstack 145 146 Placement directives: 147 148 OpenStack environments support the following placement directives for use 149 with "juju bootstrap" and "juju add-machine": 150 151 zone=<availability-zone-name> 152 The "zone" placement directive instructs the OpenStack provider to 153 allocate a machine in the specified availability zone. If the zone 154 does not exist, or a machine cannot be allocated within it, then 155 the machine addition will fail. 156 157 Other OpenStack Based Clouds: 158 159 This answer is for generic OpenStack support, if you're using an OpenStack-based 160 provider check these questions out for provider-specific information: 161 162 https://juju.ubuntu.com/docs/config-hpcloud.html 163 164 ` 165 166 const helpEC2Provider = ` 167 Configuring the EC2 environment requires telling Juju about your AWS access key 168 and secret key. To do this, you can either set the 'AWS_ACCESS_KEY_ID' and 169 'AWS_SECRET_ACCESS_KEY' environment variables[1] (as usual for other EC2 tools) 170 or you can add access-key and secret-key options to your environments.yaml. 171 These are already in place in the generated config, you just need to uncomment 172 them out. For example: 173 174 sample_ec2: 175 type: ec2 176 # access-key: YOUR-ACCESS-KEY-GOES-HERE 177 # secret-key: YOUR-SECRET-KEY-GOES-HERE 178 179 See the EC2 provider documentation[2] for more options. 180 181 Note If you already have an AWS account, you can determine your access key by 182 visiting your account page[3], clicking "Security Credentials" and then clicking 183 "Access Credentials". You'll be taken to a table that lists your access keys and 184 has a "show" link for each access key that will reveal the associated secret 185 key. 186 187 And that's it, you're ready to go! 188 189 Placement directives: 190 191 EC2 environments support the following placement directives for use with 192 "juju bootstrap" and "juju add-machine": 193 194 zone=<availability-zone-name> 195 The "zone" placement directive instructs the EC2 provider to 196 allocate a machine in the specified availability zone. If the zone 197 does not exist, or a machine cannot be allocated within it, then 198 the machine addition will fail. 199 200 References: 201 202 [1]: http://askubuntu.com/questions/730/how-do-i-set-environment-variables 203 [2]: https://juju.ubuntu.com/docs/provider-configuration-ec2.html 204 [3]: http://aws.amazon.com/account 205 206 More information: 207 208 https://juju.ubuntu.com/docs/getting-started.html 209 https://juju.ubuntu.com/docs/provider-configuration-ec2.html 210 http://askubuntu.com/questions/225513/how-do-i-configure-juju-to-use-amazon-web-services-aws 211 ` 212 213 const helpHPCloud = ` 214 HP Cloud is an Openstack cloud provider. To deploy to it, use an openstack 215 environment type for Juju, which would look something like this: 216 217 sample_hpcloud: 218 type: openstack 219 tenant-name: "juju-project1" 220 auth-url: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0/ 221 auth-mode: userpass 222 username: "xxxyour-hpcloud-usernamexxx" 223 password: "xxxpasswordxxx" 224 region: az-1.region-a.geo-1 225 226 See the online help for more information: 227 228 https://juju.ubuntu.com/docs/config-hpcloud.html 229 ` 230 231 const helpAzureProvider = ` 232 A generic Windows Azure environment looks like this: 233 234 sample_azure: 235 type: azure 236 237 # Location for instances, e.g. West US, North Europe. 238 location: West US 239 240 # http://msdn.microsoft.com/en-us/library/windowsazure 241 # Windows Azure Management info. 242 management-subscription-id: 886413e1-3b8a-5382-9b90-0c9aee199e5d 243 management-certificate-path: /home/me/azure.pem 244 245 # Windows Azure Storage info. 246 storage-account-name: juju0useast0 247 248 # Override OS image selection with a fixed image for all deployments. 249 # Most useful for developers. 250 # force-image-name: b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-13_10-amd64-server-DEVELOPMENT-20130713-Juju_ALPHA-en-us-30GB 251 252 # image-stream chooses a simplestreams stream from which to select 253 # OS images, for example daily or released images (or any other stream 254 # available on simplestreams). 255 # 256 # image-stream: "released" 257 258 # agent-stream chooses a simplestreams stream from which to select tools, 259 # for example released or proposed tools (or any other stream available 260 # on simplestreams). 261 # 262 # agent-stream: "released" 263 264 This is the environments.yaml configuration file needed to run on Windows Azure. 265 You will need to set the management-subscription-id, management-certificate- 266 path, and storage-account-name. 267 268 Note: Other than location, the defaults are recommended, but can be updated to 269 your preference. 270 271 See the online help for more information: 272 273 https://juju.ubuntu.com/docs/config-azure.html 274 ` 275 276 const helpMAASProvider = ` 277 A generic MAAS environment looks like this: 278 279 sample_maas: 280 type: maas 281 maas-server: 'http://<my-maas-server>:80/MAAS' 282 maas-oauth: 'MAAS-API-KEY' 283 284 The API key can be obtained from the preferences page in the MAAS web UI. 285 286 Placement directives: 287 288 MAAS environments support the following placement directives for use with 289 "juju bootstrap" and "juju add-machine": 290 291 zone=<physical-zone-name> 292 The "zone" placement directive instructs the MAAS provider to 293 allocate a machine in the specified availability zone. If the zone 294 does not exist, or a machine cannot be allocated within it, then 295 the machine addition will fail. 296 297 <hostname> 298 If the placement directive does not contain an "=" symbol, then 299 it is assumed to be the hostname of a node in MAAS. MAAS will attempt 300 to acquire that node and will fail if it cannot. 301 302 See the online help for more information: 303 304 https://juju.ubuntu.com/docs/config-maas.html 305 ` 306 307 const helpConstraints = ` 308 Constraints constrain the possible instances that may be started by juju 309 commands. They are usually passed as a flag to commands that provision a new 310 machine (such as bootstrap, deploy, and add-machine). 311 312 Each constraint defines a minimum acceptable value for a characteristic of a 313 machine. Juju will provision the least expensive machine that fulfills all the 314 constraints specified. Note that these values are the minimum, and the actual 315 machine used may exceed these specifications if one that exactly matches does 316 not exist. 317 318 If a constraint is defined that cannot be fulfilled by any machine in the 319 environment, no machine will be provisioned, and an error will be printed in the 320 machine's entry in juju status. 321 322 Constraint defaults can be set on an environment or on specific services by 323 using the set-constraints command (see juju help set-constraints). Constraints 324 set on the environment or on a service can be viewed by using the get- 325 constraints command. In addition, you can specify constraints when executing a 326 command by using the --constraints flag (for commands that support it). 327 328 Constraints specified on the environment and service will be combined to 329 determine the full list of constraints on the machine(s) to be provisioned by 330 the command. Service-specific constraints will override environment-specific 331 constraints, which override the juju default constraints. 332 333 Constraints are specified as key value pairs separated by an equals sign, with 334 multiple constraints delimited by a space. 335 336 Constraint Types: 337 338 arch 339 Arch defines the CPU architecture that the machine must have. Currently 340 recognized architectures: 341 amd64 (default) 342 i386 343 arm 344 345 cpu-cores 346 Cpu-cores is a whole number that defines the number of effective cores the 347 machine must have available. 348 349 mem 350 Mem is a float with an optional suffix that defines the minimum amount of RAM 351 that the machine must have. The value is rounded up to the next whole 352 megabyte. The default units are megabytes, but you can use a size suffix to 353 use other units: 354 355 M megabytes (default) 356 G gigabytes (1024 megabytes) 357 T terabytes (1024 gigabytes) 358 P petabytes (1024 terabytes) 359 360 root-disk 361 Root-Disk is a float that defines the amount of space in megabytes that must 362 be available in the machine's root partition. For providers that have 363 configurable root disk sizes (such as EC2) an instance with the specified 364 amount of disk space in the root partition may be requested. Root disk size 365 defaults to megabytes and may be specified in the same manner as the mem 366 constraint. 367 368 container 369 Container defines that the machine must be a container of the specified type. 370 A container of that type may be created by juju to fulfill the request. 371 Currently supported containers: 372 none - (default) no container 373 lxc - an lxc container 374 kvm - a kvm container 375 376 cpu-power 377 Cpu-power is a whole number that defines the speed of the machine's CPU, 378 where 100 CpuPower is considered to be equivalent to 1 Amazon ECU (or, 379 roughly, a single 2007-era Xeon). Cpu-power is currently only supported by 380 the Amazon EC2 environment. 381 382 tags 383 Tags defines the list of tags that the machine must have applied to it. 384 Multiple tags must be delimited by a comma. Both positive and negative 385 tags constraints are supported, the latter have a "^" prefix. Tags are 386 currently only supported by the MaaS environment. 387 388 networks 389 Networks defines the list of networks to ensure are available or not on the 390 machine. Both positive and negative network constraints can be specified, the 391 later have a "^" prefix to the name. Multiple networks must be delimited by a 392 comma. Not supported on all providers. Example: networks=storage,db,^logging 393 specifies to select machines with "storage" and "db" networks but not "logging" 394 network. Positive network constraints do not imply the networks will be enabled, 395 use the --networks argument for that, just that they could be enabled. 396 397 instance-type 398 Instance-type is the provider-specific name of a type of machine to deploy, 399 for example m1.small on EC2 or A4 on Azure. Specifying this constraint may 400 conflict with other constraints depending on the provider (since the instance 401 type my determine things like memory size etc.) 402 403 Example: 404 405 juju add-machine --constraints "arch=amd64 mem=8G tags=foo,^bar" 406 407 See Also: 408 juju help set-constraints 409 juju help get-constraints 410 juju help deploy 411 juju help add-unit 412 juju help add-machine 413 juju help bootstrap 414 ` 415 416 const helpPlacement = ` 417 Placement directives provide users with a means of providing instruction 418 to the cloud provider on how to allocate a machine. For example, the MAAS 419 provider can be directed to acquire a particular node by specifying its 420 hostname. 421 422 See provider-specific documentation for details of placement directives 423 supported by that provider. 424 425 Examples: 426 427 # Bootstrap using an instance in the "us-east-1a" EC2 availability zone. 428 juju bootstrap --to zone=us-east-1a 429 430 # Acquire the node "host01.maas" and add it to Juju. 431 juju add-machine host01.maas 432 433 See also: 434 juju help add-machine 435 juju help bootstrap 436 ` 437 438 const helpGlossary = ` 439 Bootstrap 440 To boostrap an environment means initializing it so that Services may be 441 deployed on it. 442 443 Charm 444 A Charm provides the definition of the service, including its metadata, 445 dependencies to other services, packages necessary, as well as the logic for 446 management of the application. It is the layer that integrates an external 447 application component like Postgres or WordPress into Juju. A Juju Service may 448 generally be seen as the composition of its Juju Charm and the upstream 449 application (traditionally made available through its package). 450 451 Charm URL 452 A Charm URL is a resource locator for a charm, with the following format and 453 restrictions: 454 455 <schema>:[~<user>/]<collection>/<name>[-<revision>] 456 457 schema must be either "cs", for a charm from the Juju charm store, or "local", 458 for a charm from a local repository. 459 460 user is only valid in charm store URLs, and allows you to source charms from 461 individual users (rather than from the main charm store); it must be a valid 462 Launchpad user name. 463 464 collection denotes a charm's purpose and status, and is derived from the 465 Ubuntu series targeted by its contained charms: examples include "precise", 466 "quantal", "oneiric-universe". 467 468 name is just the name of the charm; it must start and end with lowercase 469 (ascii) letters, and can otherwise contain any combination of lowercase 470 letters, digits, and "-"s. 471 472 revision, if specified, points to a specific revision of the charm pointed to 473 by the rest of the URL. It must be a non-negative integer. 474 475 Endpoint 476 The combination of a service name and a relation name. 477 478 Environment 479 An Environment is a configured location where Services can be deployed onto. 480 An Environment typically has a name, which can usually be omitted when there's 481 a single Environment configured, or when a default is explicitly defined. 482 Depending on the type of Environment, it may have to be bootstrapped before 483 interactions with it may take place (e.g. EC2). The local environment 484 configuration is defined in the ~/.juju/environments.yaml file. 485 486 Machine Agent 487 Software which runs inside each machine that is part of an Environment, and is 488 able to handle the needs of deploying and managing Service Units in this 489 machine. 490 491 Placement Directive 492 A provider-specific string that directs the provisioner on how to allocate a 493 machine instance. 494 495 Provisioning Agent 496 Software responsible for automatically allocating and terminating machines in 497 an Environment, as necessary for the requested configuration. 498 499 Relation 500 Relations are the way in which Juju enables Services to communicate to each 501 other, and the way in which the topology of Services is assembled. The Charm 502 defines which Relations a given Service may establish, and what kind of 503 interface these Relations require. 504 505 In many cases, the establishment of a Relation will result into an actual TCP 506 connection being created between the Service Units, but that's not necessarily 507 the case. Relations may also be established to inform Services of 508 configuration parameters, to request monitoring information, or any other 509 details which the Charm author has chosen to make available. 510 511 Repository 512 A location where multiple charms are stored. Repositories may be as simple as 513 a directory structure on a local disk, or as complex as a rich smart server 514 supporting remote searching and so on. 515 516 Service 517 Juju operates in terms of services. A service is any application (or set of 518 applications) that is integrated into the framework as an individual component 519 which should generally be joined with other components to perform a more 520 complex goal. 521 522 As an example, WordPress could be deployed as a service and, to perform its 523 tasks properly, might communicate with a database service and a load balancer 524 service. 525 526 Service Configuration 527 There are many different settings in a Juju deployment, but the term Service 528 Configuration refers to the settings which a user can define to customize the 529 behavior of a Service. 530 531 The behavior of a Service when its Service Configuration changes is entirely 532 defined by its Charm. 533 534 Service Unit 535 A running instance of a given Juju Service. Simple Services may be deployed 536 with a single Service Unit, but it is possible for an individual Service to 537 have multiple Service Units running in independent machines. All Service Units 538 for a given Service will share the same Charm, the same relations, and the 539 same user-provided configuration. 540 541 For instance, one may deploy a single MongoDB Service, and specify that it 542 should run 3 Units, so that the replica set is resilient to failures. 543 Internally, even though the replica set shares the same user-provided 544 configuration, each Unit may be performing different roles within the replica 545 set, as defined by the Charm. 546 547 Service Unit Agent 548 Software which manages all the lifecycle of a single Service Unit. 549 550 ` 551 552 const helpLogging = ` 553 Juju has logging available for both client and server components. Most 554 users' exposure to the logging mechanism is through either the 'debug-log' 555 command, or through the log file stored on the bootstrap node at 556 /var/log/juju/all-machines.log. 557 558 All the agents have their own log files on the individual machines. So 559 for the bootstrap node, there is the machine agent log file at 560 /var/log/juju/machine-0.log. When a unit is deployed on a machine, 561 a unit agent is started. This agent also logs to /var/log/juju and the 562 name of the log file is based on the id of the unit, so for wordpress/0 563 the log file is unit-wordpress-0.log. 564 565 Juju uses rsyslog to forward the content of all the log files on the machine 566 back to the bootstrap node, and they are accumulated into the all-machines.log 567 file. Each line is prefixed with the source agent tag (also the same as 568 the filename without the extension). 569 570 Juju has a hierarchical logging system internally, and as a user you can 571 control how much information is logged out. 572 573 Output from the charm hook execution comes under the log name "unit". 574 By default Juju makes sure that this information is logged out at 575 the DEBUG level. If you explicitly specify a value for unit, then 576 this is used instead. 577 578 Juju internal logging comes under the log name "juju". Different areas 579 of the codebase have different anmes. For example: 580 providers are under juju.provider 581 workers are under juju.worker 582 database parts are under juju.state 583 584 All the agents are started with all logging set to DEBUG. Which means you 585 see all the internal juju logging statements until the logging worker starts 586 and updates the logging configuration to be what is stored for the environment. 587 588 You can set the logging levels using a number of different mechanisms. 589 590 environments.yaml 591 - all environments support 'logging-config' as a key 592 - logging-config: ... 593 environment variable 594 - export JUJU_LOGGING_CONFIG='...' 595 setting the logging-config at bootstrap time 596 - juju bootstrap --logging-config='...' 597 juju set-environment logging-config='...' 598 599 Configuration values are separated by semicolons. 600 601 Examples: 602 603 juju set-environment logging-config "juju=WARNING; unit=INFO" 604 605 Developers may well like: 606 607 export JUJU_LOGGING_CONFIG='juju=INFO; juju.current.work.area=TRACE' 608 609 Valid logging levels: 610 CRITICAL 611 ERROR 612 WARNING 613 INFO 614 DEBUG 615 TRACE 616 `