skip to navigation
skip to content

cloudcontrol 0.0.5

CloudControl gives you simplified automation of remote machines in the cloud.

Description

CloudControl gives you a simplified interface for dealing with a bunch of machines in the cloud. With simple Python syntax, you can script all of your remote machines simultaneously.

Usage

This simple example shows a way to list the running processes on your appservers:

from cloudcontrol import Role

appserver = Role("machine1@example.com", "machine2@example.com", "machine3@example.com")

for user, response in responses.iteritems():
    print "--- stdout for %s:\n%s" % (user, response.stdout)

raise SystemExit(1) # paramiko appears to hang otherwise

This will print something like this:

--- stdout for machine1@example.com:
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   2040   608 ?        Ss   May30   1:34 init [2]
root         2  0.0  0.0      0     0 ?        S<   May30   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S<   May30   0:02 [migration/0]
--- stdout for machine2@example.com:
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   2040   608 ?        Ss   May30   1:34 init [2]
root         2  0.0  0.0      0     0 ?        S<   May30   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S<   May30   0:02 [migration/0]
--- stdout for machine3@example.com:
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0   2040   608 ?        Ss   May30   1:34 init [2]
root         2  0.0  0.0      0     0 ?        S<   May30   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S<   May30   0:02 [migration/0]

More docs to come.

Known Issues

There appears to be a problem with shutting down the underlying paramiko library at the end of the script. Paramiko provides SSH access for CloudControl.