Comments (8)
Arg. My head hurts trying to make this work with:
- count
- node_count
- drive_count
...and a bunch of mod arithmetic. It looks like 0.12 is going to be out imminently. Thinking just wait for that... https://www.hashicorp.com/blog/hashicorp-terraform-0-12-preview-for-and-for-each
from oci-cloudera.
import math
#Variables
node_count=7
disk_count=5
availability_domains=3
#Nodes
print('i\tinstance\tad')
count=node_count
for i in range(0, count):
instance=i
availability_domain=i%availability_domains
print(str(i) + '\t' + str(instance) + '\t\t' + str(availability_domain))
print('')
#Disks
print('i\tinstance\tvolume\tad')
count=node_count*disk_count
for i in range(0,count):
instance_id = i%node_count
availability_domain = i%node_count%availability_domains
volume_id = math.floor(i/node_count)
print(str(i) + '\t' + str(instance_id) + '\t\t' + str(volume_id) + '\t' + str(availability_domain))
from oci-cloudera.
This is really weird:
worker3 has the disk count0worker0-volume0 attached. They're both in AD 0=YVsm:PHX-AD-1
count = "${var.worker["node_count"] * var.worker["disk_count"]}"
35=7*5
count0worker0-volume0
availability_domain = "${lookup(data.oci_identity_availability_domains.availability_domains.availability_domains[count.index % var.worker["node_count"] % var.availability_domains], "name")}"
0%7%3=0
display_name = "count${count.index}worker${count.index%var.worker["node_count"]}-volume${floor(count.index / var.worker["node_count"])}"
Count - 0
worker - 0%7=0
volume - floor(0/7)=0
instance_id = "${oci_core_instance.worker.*.id[count.index % var.worker["node_count"]]}"
0%7=0
volume_id = "${oci_core_volume.worker.*.id[floor(count.index / var.worker["node_count"])]}"
floor(0/7)=0
from oci-cloudera.
from oci-cloudera.
This is the terraform generating this: https://github.com/cloud-partners/oci-cloudera-edh/blob/e8806d484be6b012bf8122a713e65f799eee1d99/production/worker.tf#L1-L38
from oci-cloudera.
from oci-cloudera.
I think I got it. The volume id isn't per node, it's global. Whoops.
from oci-cloudera.
Woot!
from oci-cloudera.
Related Issues (20)
- Switch to OEL HOT 2
- Auto-TLS HOT 3
- Clean up Postgres Permissions (or maybe move to MySQL instead) HOT 2
- Multiple Utility Nodes HOT 1
- Upgrade install script to current Swagger client HOT 2
- Setup rack awareness HOT 6
- Timed out waiting for worker process collecting filesystem usage to complete. HOT 4
- Adding workers deletes existing workers first HOT 3
- Aren't Standard1 instances gone for new users? HOT 1
- Consolidate EDH and DSW repos HOT 1
- Merge dsw into master HOT 4
- Best Practice Review HOT 2
- Take a dependency on oci-prerequisites. Drop env-vars HOT 1
- python dependencies HOT 1
- Auth issue HOT 3
- Seems to be an issue with current branch HOT 2
- Terraform v0.12.7 incompatible HOT 2
- stack giving errors HOT 1
- Issues found while deploying current template using existing VCN
- Metadata size issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oci-cloudera.