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

Adds support for named networks #43

Closed
wants to merge 3 commits into from

Conversation

bkmeneguello
Copy link

@bkmeneguello bkmeneguello commented Oct 18, 2019

Allow to define -n <network_name> to create the VM attached to that network
Probably fixes #16

Allow to define `-n <network_name>` to create the VM attached to that network
@giovtorres giovtorres added the feature New Feature label Oct 20, 2019
Copy link
Owner

@giovtorres giovtorres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bkmeneguello. Thank you for your contribution! This looks great. A couple comments below. Also, could you update the README with the newly added option.

kvm-install-vm Outdated Show resolved Hide resolved
kvm-install-vm Outdated Show resolved Hide resolved
Comment on lines +621 to +630
if [ -n "${NETWORK_NAME}" ]
then
NETWORK_PARAMS="$(param network ${NETWORK_NAME})"
elif [ -n "${BRIDGE}" ]
then
NETWORK_PARAMS="$(param bridge ${BRIDGE})"
else
NETWORK_PARAMS="none"
fi

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -691,6 +702,10 @@ _EOF_
outputn "Cleaning up cloud-init files"
rm -f $USER_DATA $META_DATA $CI_ISO && ok

if [ -n "${NETWORK_NAME}" ]; then
BRIDGE=$(virsh net-dumpxml "${NETWORK_NAME}" | awk -F\' '/bridge/ {print $2}')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit nervous about splitting on the first single quote. What if name= is not first in the bridge tag?

What about something like: virsh net-info "${NETWORK_NAME}" | awk -F':' '/Bridge/ {print $2}' | tr -d ' ' ?

Thoughts?

@giovtorres
Copy link
Owner

Are you still working on this PR?

@giovtorres giovtorres closed this Mar 13, 2020
imgrant added a commit to imgrant/kvm-install-vm that referenced this pull request Nov 3, 2020
Following suggestion from 22-Oct-2019 in stale PR giovtorres#43 to upstream fork
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New Feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No static network options?
2 participants