Machine: Dockermachinefile

Created on 4 Oct 2016  ·  5Comments  ·  Source: docker/machine

I shoot this. How about adding some sort of dockermachinefile.yml support?

This in my mind is a file defining machines to be created, something like

amazonec2:
  - name: test_amazon
    count: 10
    ami:
    ssh-user
    ...

Then

docker-machine create -f dockermachinefile.yml

creates them (in parallel possibly) test_amazon0, test_amazon1, test_amazon9... How does it sound?

Most helpful comment

I'm doing this kind of stuff with docker machine already at tsuru. We configure it using an .yml file where we basically say how many machines we want created, global driver options and a driver parameters to cycle while creating the cluster. For example:

name: installr
hosts:
    core:
        size: 4
        driver:
            options:
                amazonec2-zone: ["a", "b"]
    apps:
        size: 3
        driver:
            options:
                amazonec2-zone: ["a", "b", "c"]

driver:
    name: amazonec2
    options:
        amazonec2-access-key: XXXXXX
        amazonec2-secret-key: YYYYYYY
        amazonec2-vpc-id: ZZZZZZ

I have two types of hosts core and apps. It will create 2 core hosts on each zone a and b, while apps hosts will be created on 3 different zones. The global driver options: amazonec2-access-key, amazonec2-secret-key, amazonec2-vpc-id will be the same of all of them(but can be ovewritten).

The name is used as a prefix.

All 5 comments

It's been considered (I've even made a implementation, sorta, https://github.com/nathanleclaire/machine-compose) however I think https://github.com/docker/infrakit will be where the focus will be for this type of operation in the future. Machine will stay as it is for creating and managing one-off machines via CLI.

@nathanleclaire Say what!? You kind of implied that InfraKit is going to replace docker-machine. Like docker-machine is the new "Old Swarm."

Sorry for the confusion @ibuildthecloud

Machine is not being replaced by infra-kit, and I don't think they have the same relationship that old-swarm has with swarm.

This here should be reopened, as it's worth considering for machine.

Yah thanks for clarifying ;)

I'm doing this kind of stuff with docker machine already at tsuru. We configure it using an .yml file where we basically say how many machines we want created, global driver options and a driver parameters to cycle while creating the cluster. For example:

name: installr
hosts:
    core:
        size: 4
        driver:
            options:
                amazonec2-zone: ["a", "b"]
    apps:
        size: 3
        driver:
            options:
                amazonec2-zone: ["a", "b", "c"]

driver:
    name: amazonec2
    options:
        amazonec2-access-key: XXXXXX
        amazonec2-secret-key: YYYYYYY
        amazonec2-vpc-id: ZZZZZZ

I have two types of hosts core and apps. It will create 2 core hosts on each zone a and b, while apps hosts will be created on 3 different zones. The global driver options: amazonec2-access-key, amazonec2-secret-key, amazonec2-vpc-id will be the same of all of them(but can be ovewritten).

The name is used as a prefix.

Was this page helpful?
0 / 5 - 0 ratings