Skip to content

Instantly share code, notes, and snippets.

Created November 3, 2014 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3006741be1d459091824 to your computer and use it in GitHub Desktop.
Save anonymous/3006741be1d459091824 to your computer and use it in GitHub Desktop.
We’re using salt-cloud with provider ‘OpenStack’. (we can of course also use Nova, if that solves stuff).
Our cloud account is:
- Managed Operations
- RackConnect v3.0 (using multiple cloud-networks with private ip ranges in 192.168.0.0/16)
We’ve got
- A cloud-provider set up
- Multiple (simple) profiles
- Multiple operating systems to support (Windows and Linux)
- Multiple Cloud-Networks (RackConnect v3.0)
Question: How can we best implement Salt configuration to support multiple cloud networks and multiple operating systems?
- For multiple operating systems:
o In salt-cloud configuration you can set things like ssh_key_name, ssh_interface, as wel as win_* properties
o We don’t want to set these as global parameters in the cloud.provider, as they’re OS specific
o Nor in *each* VM profile, we want to define them once, and reference it (manually or automatic through a property)
- For multiple networks
o We should only define one ‘set’ of networks per VM.
o We don’t want to set these globally in the cloud.provider,
o Nor in *each* VM profile, we want to define all ‘network configurations’ once and reference them.
If both of the above are done in the cloud.profiles, that would also mean , <num VM profiles> * <num cloud networks> * <num of OS> = number of total cloud.profiles.
Examples of our cloud-networks
RC-CLD-DMZ-SHARED:
networks:
- fixed:
- 3661d522-c05d-4bf7-9381-57dc9ae26092 # RC-CLD-DMZ-SHARED - 192.168.161.0/26
- 11111111-1111-1111-1111-111111111111 # ServiceNet
RC-CLD-SSN-SHARED:
networks:
- fixed:
- 1adf0d3e-c987-4ed5-a592-ef3d8d565a9c # RC-CLD-SSN-SHARED - 192.168.162.0/26
- 11111111-1111-1111-1111-111111111111 # ServiceNet
RC-CLD-SSN-MGT:
networks:
- fixed:
- af1a9935-63ec-40a3-ad30-55cc0ac25a1f # RC-CLD-SSN-MGT- 192.168.163.0/26
- 11111111-1111-1111-1111-111111111111 # ServiceNet
Etc, etc. (up to 10 networks)
Example of OS specific cloud provider settings (for deployment)
# Linux
ssh_interface: private_ips
ssh_key_name: SSH_PubKey_SaltMaster
# Windows
win_installer: /root/Salt-Minion-0.17.0-AMD64-Setup.exe
win_username: Administrator
win_password: letmein
files:
C:\\cloud-automation\\bootstrap.cmd:
/etc/salt/cloud.deploy.d/bootstrap-w2k8.cmd
Example of our cloud.profiles:
ubuntu_14.04_pvhvm_perf1-1:
provider: rackspace-cloud
size: performance1-1
image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
ubuntu_14.04_pvhvm_perf1-2:
provider: rackspace-cloud
size: performance1-2
image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
ubuntu_14.04_pvhvm_perf1-4:
provider: rackspace-cloud
size: performance1-4
image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
ubuntu_14.04_pvhvm_perf1-8:
provider: rackspace-cloud
size: performance1-8
image: Ubuntu 14.04 LTS (Trusty Tahr) (PVHVM)
windows_2k8.r2_perf1-2:
provider: rackspace-cloud
size: performance1-2
image: Windows Server 2008 R2 SP1
windows_2k8.r2_perf1-4:
provider: rackspace-cloud
size: performance1-4
image: Windows Server 2008 R2 SP1
What we want to prevent:
# Example of /etc/salt/cloud.profile. We’d have near to 100 of these:
Linux_ubuntu_perf1-1.DMZ-SHARED:
extends: ubuntu_14.04_pvhvm_perf1-1
ssh_interface: private_ips
ssh_key_name: SSH_PubKey_SaltMaster
networks:
- fixed:
- 3661d522-c05d-4bf7-9381-57dc9ae26092
- 11111111-1111-1111-1111-111111111111
grains:
environment: dev
roles:
- baseline
site: lon3
windows_2k8.r2_perf1-2.SSN-SHARED:
extends: windows_2k8.r2_perf1-2
win_installer: /root/Salt-Minion-0.17.0-AMD64-Setup.exe
win_username: Administrator
win_password: letmein
files:
C:\\cloud-automation\\bootstrap.cmd:
/etc/salt/cloud.deploy.d/bootstrap-w2k8.cmd
networks:
- fixed:
- 3661d522-c05d-4bf7-9381-57dc9ae26092
- 11111111-1111-1111-1111-111111111111
grains:
environment: dev
roles:
- baseline
site: lon3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment