github.com/emc-advanced-dev/unik@v0.0.0-20190717152701-a58d3e8e33b7/docs/configure.md (about)

     1  # Configuring UniK
     2  
     3  1. [Daemon Config](configure.md#daemon-config)
     4      * [Virtualbox](configure.md#virtualbox)
     5      * [AWS](configure.md#aws)
     6      * [vSphere](configure.md#vsphere)
     7  3. [CLI Config](configure.md#cli-config)
     8  
     9  ## Daemon Config
    10  Starting the UniK daemon with `unik daemon` requires a `yaml` file with configuration for each desired [provider](providers/README.md).
    11  
    12  By default, `unik daemon` reads from a configuration file located at `$HOME/.unik/daemon-config.yaml`. We recommend placing your config file there. However, you can specify a different config file with `unik daemon --f <path-to-file>`.
    13  
    14  UniK requires valid `yaml` matching the following [example](examples/example-daemon-conf.yml):
    15  ```yaml
    16  providers:
    17    aws:
    18      - name: aws-1
    19        region: us-west-1
    20        zone: us-west-1a
    21    vsphere:
    22      - name: vsphere-1
    23        vsphere_user: user
    24        vsphere_password: password
    25        vsphere_url: url
    26        datastore: datastore1
    27        datacenter: ha-datacenter
    28        network: VM Network
    29    virtualbox:
    30      - name: my-vbox
    31        adapter_name: vboxnet0
    32        adapter_type: host_only
    33  version: 0.0.0
    34  ```
    35  
    36  Include the provider stub for any provider you wish to use. For example, to use only Virtualbox, your `daemon-config.yaml` should look like this.
    37  
    38  ```yaml
    39  providers:
    40    virtualbox:
    41      - name: my_virtualbox_provider
    42        adapter_type: host_only
    43        adapter_name: vboxnet0
    44  ```
    45  If using both AWS and vSphere, the file should look like so:
    46  ```yaml
    47  providers:
    48    aws:
    49      - name: aws-1
    50        region: us-west-1
    51        zone: us-west-1a
    52    vsphere:
    53      - name: vsphere-1
    54        vsphere_user: user
    55        vsphere_password: password
    56        vsphere_url: url
    57        datastore: datastore1
    58        datacenter: ha-datacenter
    59        network: VM Network
    60  ```
    61  
    62  ### Providers
    63  
    64  #### Virtualbox
    65  To run on virtualbox, you will need to tell UniK what type of network card to attach to instances. Available options are `host_only` for [Host-Only Networking](https://www.virtualbox.org/manual/ch06.html#network_hostonly), or `bridged` for [Bridged Networking](https://www.virtualbox.org/manual/ch06.html#network_bridged). UniK must also know the name of the network adapter to use. These are the only properties that virtualbox provider requires. (`name` field is not used currently).
    66  
    67  In the Virtualbox stub:
    68  ```yaml
    69    virtualbox:
    70      - name: any-name-you-want
    71        adapter_type: ADAPTER_TYPE
    72        adapter_name: ADAPTER_NAME
    73  ```
    74  * Set `ADAPTER_TYPE` to `host_only` or `bridged`
    75  * Set `ADAPTER_NAME` to the name of the adapter. If using `host_only`, you may need to [create a HostOnly network in Virtualbox](http://askubuntu.com/questions/293816/in-virtualbox-how-do-i-set-up-host-only-virtual-machines-that-can-access-the-in).
    76  
    77  #### AWS
    78  AWS provider in UniK assumes use of default AWS credential chain. This means either [setting AWS access key id and secret key in your environment](http://docs.aws.amazon.com/aws-sdk-php/v2/guide/credentials.html#environment-credentials), or using the default [AWS configuration file](http://docs.aws.amazon.com/cli/latest/topic/config-vars.html).
    79  
    80  Region and zone should be specified like so in the AWS stub:
    81  ```yaml
    82    aws:
    83      - name: any-name-you-want
    84        region: us-west-1
    85        zone: us-west-1a
    86  ```
    87  
    88  #### vSphere
    89  vSphere provider requires vSphere username, password, url (in the format `http://host_url` or `https://host_url`), as well as the name of the datacenter and datastore to use for vmdk storage.
    90  
    91  `network` is optional; use it to specify the label of the vSphere network to attach vSphere instances to. If left empty, UniK will attempt to use the default network ('VM Network').
    92  
    93  ```yaml
    94    vsphere:
    95      - name: any-name-you-want
    96        vsphere_user: user
    97        vsphere_password: password
    98        vsphere_url: url
    99        datastore: datastore1
   100        datacenter: ha-datacenter
   101        network: VM Network
   102  ```
   103  
   104  ## CLI Config
   105  After the daemon is running, you can target it through the CLI. To target the daemon, run `unik target --host <host_url>` where `host_url` is the url of the host running the daemon. If running the host on your local machine, you can just use `unik target --host localhost`