Created
October 30, 2014 08:05
-
-
Save uksysadmin/95266128a14b2b7b4867 to your computer and use it in GitHub Desktop.
cloud-init multi-nic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Create a file called 'multi-nic': | |
#!/bin/bash | |
echo "Running cloud-init script" > /tmp/cloud-init.log | |
/sbin/ifconfig -a | /usr/bin/awk '/eth.*Ethernet/ {print $1}' | while read E; do /usr/bin/sudo /sbin/dhclient $E; done | |
2. When booting an image: | |
nova boot --image ubuntu-trusty --flavor 2 --key-name mykey --nic net-id=network1 --nic net-id=network2 --user-data ./multi-nic myinstance1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment