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

Add bridge networks support for libvirt VMs #721

Open
wants to merge 2 commits into
base: integration
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion core/commands/partials/vagrant_configuration_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ def get_libvirt_definition(_cookbook_path, path, node_params)
<% if ssh_pty %>
box.ssh.pty = <%= ssh_pty %>
<% end %>
<% if bridge_name %>
box.vm.network :public_network, :dev => '<%= bridge_name %>', :type => 'bridge'
<% end %>
<% if ipv6 %>
box.vm.network :public_network, :dev => 'virbr0', :mode => 'bridge', :type => 'bridge'
<% end %>
Expand Down Expand Up @@ -228,7 +231,8 @@ def make_node_params(node, box_params)
name: node[0].to_s,
host: node[1]['hostname'].to_s,
vm_mem: node[1]['memory_size'].nil? ? '1024' : node[1]['memory_size'].to_s,
vm_cpu: (@env.cpu_count || node[1]['cpu_count'] || '1').to_s
vm_cpu: (@env.cpu_count || node[1]['cpu_count'] || '1').to_s,
bridge_name: node[1]['bridge_name'].nil? ? nil : node[1]['bridge_name'].to_s
}.merge(symbolic_box_params)
end

Expand Down
1 change: 1 addition & 0 deletions docs/src/virtual_machines/machine_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Optional parameters are product, products, labels, cnf_template_path, box_parame
* `labels` is a set of labels. Names groups of machines that could be brought up independently of other machines in the configuration file. A set of machines with the same labels will be created when calling `mdbci up` with `--labels` option.
* `cnf_template_path` is the path to the configuration files to be passed to the machine. When installing a database you must also specify the name of the configuration file and the path to the folder where the file is stored. It is advised to use absolute path in `cnf_template_path` as the relative path is calculated from within the configuration directory.
* `box_parameters` is a description of the selected box parameters that are being overridden for a single node (e.g. disable RHEL system registration setting `configure_subscription_manager` flag to `false`). See [boxes configuration](../general_configuration/boxes.md) for more information.
* `bridge_name` is a name of bridged network on the host to be connected to the machine (libvirt instances only).

#### Cloud node attributes

Expand Down