Code Monkey home page Code Monkey logo

Comments (8)

benofben avatar benofben commented on June 18, 2024

Arg. My head hurts trying to make this work with:

from oci-cloudera.

benofben avatar benofben commented on June 18, 2024
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.

benofben avatar benofben commented on June 18, 2024

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.

benofben avatar benofben commented on June 18, 2024

image

from oci-cloudera.

benofben avatar benofben commented on June 18, 2024

This is the terraform generating this: https://github.com/cloud-partners/oci-cloudera-edh/blob/e8806d484be6b012bf8122a713e65f799eee1d99/production/worker.tf#L1-L38

from oci-cloudera.

benofben avatar benofben commented on June 18, 2024

Ran it again. I don't get it.
image

from oci-cloudera.

benofben avatar benofben commented on June 18, 2024

I think I got it. The volume id isn't per node, it's global. Whoops.

from oci-cloudera.

benofben avatar benofben commented on June 18, 2024

Woot!

from oci-cloudera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.