Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clone template X times #10

Closed
jctanner opened this issue Aug 7, 2014 · 4 comments
Closed

clone template X times #10

jctanner opened this issue Aug 7, 2014 · 4 comments

Comments

@jctanner
Copy link

jctanner commented Aug 7, 2014

If my PR to #3 is accepted, I'd like to further extend the clone subcommand to include a --count parameter. The purpose would be to allow the end user to clone a template multiple times in the same command.

Example:

emomzi clone --template=foo --hostname=bar-%d --count=4
Cloning foo to new host bar-0
Cloning foo to new host bar-1
Cloning foo to new host bar-2
Cloning foo to new host bar-3
Waiting for bar-0 to obtain an IP address
Waiting for bar-1 to obtain an IP address
Waiting for bar-2 to obtain an IP address
Waiting for bar-4 to obtain an IP address
bar-0 10.0.0.100
bar-1 10.0.0.101
bar-2 10.0.0.102
bar-3 10.0.0.103
@snobear
Copy link
Owner

snobear commented Aug 12, 2014

Sounds good. A few thoughts/questions:

  • If a %d isn't specified, should ezmomi complain and exit, or just default the hostname to hostname-%d, for example?

In general, I like the idea of ezmomi doing the work for you with minimal params, but it would be annoying to fire off a whole bunch of VM clones to find out you don't like the host naming convention that it defaulted to :). So my vote would be to complain that ---count requires a %d in the hostname and exit.

  • add a check to complain and exit if --count is supplied with static --ips. Also brings up how to handle the situation of mixed dhcp and static, per add dhcp option #3.

@jctanner
Copy link
Author

First pass ... 70c2303

@jctanner
Copy link
Author

@snobear

  1. As written, it will default to adding a "-" suffix on the given hostname, if %s is not found in the string. I would say that this should be a policy call on your part and I will code to your decision.
  2. Yeah ... this is complicated until dhcp+static is sorted out. Perhaps it could just abort for now if NICs per VM > 1.

@snobear
Copy link
Owner

snobear commented Sep 23, 2016

Thanks for the suggestions @jctanner , but I'm going to close this for now. I like the idea but it adds complexity to this tool, e.g. static IP assignment, that could easily be achieved with a wrapper script.

@snobear snobear closed this as completed Sep 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants