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

Use multithreading to create machines #166

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

deepshikhaaa
Copy link
Member

Signed-off-by: Deepshikha Khandelwal [email protected]

Signed-off-by: Deepshikha Khandelwal <[email protected]>
@mykaul
Copy link

mykaul commented Sep 6, 2018

Why implement our own code and not:

  1. Use Ansible?
  2. Or https://github.com/CentOS-PaaS-SIG/linchpin ?

Ansible could easily run multiple VMs and not wait for the result, no? (and then you wait for it as an asyc task)

Function to check if there's successful ssh connection can be established
Function to create a node on cloud
'''
name = 'distributed-testing.'+str(uuid.uuid4())
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you use a hyphen here. This has always annoyed me :)

if not isinstance(pubkey, str):
pubkey = str(pubkey)

step = SSHKeyDeployment(pubkey)
Copy link
Contributor

Choose a reason for hiding this comment

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

You may need to have that str/unicode hack in here.

name = 'distributed-testing.'+str(uuid.uuid4())
node = conn.deploy_node(
name=name, image=image, size=flavor, deploy=step)
time.sleep(5)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you still need this sleep? I believe a Deployment waits until the node is ready to copy the key over anyway.

Signed-off-by: Deepshikha Khandelwal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants