-
Notifications
You must be signed in to change notification settings - Fork 189
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
Easily override instance name #169
Comments
Default vm instance name and hostname is now: "kt-<kitchen_root_directory>-<instance_name>". It can be overriden in .kitchen.yml by setting "instance_name" option.
When in .kitchen.yml: * vm_hostname is set to false, then use previous default behavior: not setting hostname (not using 'c.vm.define' in generated Vagrantfile) * vm_name is set to some string, leads to setting hostname and machine name in cloud dashboard * vm_name is not set and vm_hostname is not set to false, then the hostname and machine name in cloud dashboard is "kt-<kitchen_root_directory>-<instance_name>" Changed instance_name to vm_name, to avoid taking it for Test Kitchen instance.name.
I updated the PR with the 2nd commit. Let me know if you want that behavior, I can then update tests which verify generated Vagrantfile. |
+1 Hi, I also have issue with using {kitchen_root_directory} as part of the instance name due to directories with the same name or too long. How about using a CRC32 of the full path? Any thoughts? |
Ah, I see what you mean about #172 . Do you think I should open a new issue regarding my comment about {kitchen_root_directory} ? |
That would be great! If it's still a problem we'd love make sure it at least gets recorded and if you're feeling up to it a PR would be even better :D |
Will do! Thanks! |
Closing this issue as discussed. |
Since #171 was merged, I've been setting vm name under
Here I also suggested to set default machine name to |
I'd like to differentiate virtual machines by name at a cloud dashboard. (Especially I want to know which machines were created by Test-Kitchen.) When I use Vagrant, I can set instance name in Vagrantfile in the following way:
In result when I look at a cloud dashboard, I see the name of virtual machine created with Vagrant is "my-vagrant-vm". (I tested it with vagrant-openstack-provider 0.6.1 and Vagrant 1.6.5). I'd like to be able to set instance name in .kitchen.yml and see the same result.
kitchen-openstack has a nice feature to add only a prefix in instance name (
server_name_prefix
option) while the rest of the name is generated. But setting the whole instance name is enough for my case.This is related to #144,
but for me setting. I must have set it in bad scope. When I set it in provider scope, it works:vm.name
in Vagrantfile never worked, when I runvagrant status
I get this errorThe following settings shouldn't exist: name
However due to #171 I could not set it in .kitchen.yml in
customize
section.EDIT: I should have added that setting
vm_hostname
in .kitchen.yml had no effect, the instance name and hostname was "default". (Most probably kitchen-vagrant is not the place for fixing it).After #172 is merged, this is not longer needed to meet my initial goal. Still I offer a pull request which sets
config.vm.define "<your_machine_name>"
in generated Vagrantfile, because this way:As I see in Readme some people do not like changing their hostname, so I'll update my PR so that setting in .kitchen.yml
vm_hostname = false
will result in not changing hostname and machine name in cloud dashboard.The text was updated successfully, but these errors were encountered: