It's not called directly from Swift, but the start-coaster-service script does that. It calls bootit.sh(cloudinitd), extracts information from the JSON output, sets up reverse SSH tunneling if needed, starts the worker perl script on each node, and then generates Swift configuration files with the correct values.<br>
<br><div>David<br><div><div><br><div class="gmail_quote">On Tue, Jun 7, 2011 at 11:27 PM, John Bresnahan <span dir="ltr"><<a href="mailto:bresnaha@mcs.anl.gov">bresnaha@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Are we at a point where we can have cloudinit.d called from swift and have the hostnames parsed from the json output file?  That might make a good demo.<div class="im"><br>
<br>
On 06/07/2011 03:01 PM, David Kelly wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Yep, I am using the VMs I get from cloudinitd with Swift. The only problem I sometimes notice is<br>
that cloudinitd can be pretty slow to finish.. somewhere between the point where it prints the<br>
information about the hosts (hostname, instance id, etc) but before it prints the success message<br>
and exits. I was thinking maybe it's related to the hotel filesystem problems from last week, but<br>
I'm not sure. Other times cloudinitd finishes quickly without any major delays.<br>
<br>
Once it gets past initializing the VMs it runs great. I've been testing with a script called<br>
hostsn.swift which basically just calls 'hostname' several times and sends the output to a file.<br>
It's useful for verifying that all the VMs are processing work. When you get a chance to test it<br>
out, the hostsn script is in the swift examples directory. You can call it with something like this:<br>
<br>
swift -sites.file sites.xml -tc.file tc.data -config cf hostsn.swift -n=100<br>
<br>
N is the number of 'hostname' processes to launch.. the files will be created in a directory called<br>
outdir.<br>
<br>
Feel free to send me an email when you get a chance to look at it and we can talk more about it.<br>
<br>
David<br>
<br></div><div class="im">
On Tue, Jun 7, 2011 at 6:59 PM, John Bresnahan <<a href="mailto:bresnaha@mcs.anl.gov" target="_blank">bresnaha@mcs.anl.gov</a> <mailto:<a href="mailto:bresnaha@mcs.anl.gov" target="_blank">bresnaha@mcs.anl.gov</a>>><br>

wrote:<br>
<br>
    great!  I will take a look at that when I can (I am on travel right now).<br>
<br>
    Getting back to using cloudinit.d for swift... we you able to use the VMs you got from<br>
    FutureGrid with swift?  I was hoping we could start encorperating that into swift, or at least<br>
    acquire a set of VMs and use those as you currently use static machines in some demos.<br>
<br>
    ----- Original Message -----<br></div>
    From: "David Kelly" <<a href="mailto:davidkelly999@gmail.com" target="_blank">davidkelly999@gmail.com</a> <mailto:<a href="mailto:davidkelly999@gmail.com" target="_blank">davidkelly999@gmail.com</a>>><br>

    To: "John Bresnahan" <<a href="mailto:bresnaha@mcs.anl.gov" target="_blank">bresnaha@mcs.anl.gov</a> <mailto:<a href="mailto:bresnaha@mcs.anl.gov" target="_blank">bresnaha@mcs.anl.gov</a>>><br>
    Cc: "Mike Wilde" <<a href="mailto:wilde@mcs.anl.gov" target="_blank">wilde@mcs.anl.gov</a> <mailto:<a href="mailto:wilde@mcs.anl.gov" target="_blank">wilde@mcs.anl.gov</a>>>, "swift-devel"<br>

    <<a href="mailto:swift-devel@ci.uchicago.edu" target="_blank">swift-devel@ci.uchicago.edu</a> <mailto:<a href="mailto:swift-devel@ci.uchicago.edu" target="_blank">swift-devel@ci.uchicago.edu</a>>><div class="im">
<br>
    Sent: Tuesday, June 7, 2011 2:39:20 PM<br>
    Subject: Re: Getting VMs from FG for use with swift<br>
<br>
    Hello John,<br>
<br>
    I have attached a quickstart guide I wrote on how to get Swift working with futuregrid by using<br>
    the new Swift coaster service scripts. This will require the latest development version of<br>
    Swift. Instructions on how to download/install are in the document.<br>
<br>
    Please let me know if you have any questions, if anything is unclear, or if you run into any<br>
    problems. Thank you!<br>
<br>
    Regards,<br>
    David<br>
<br>
<br>
    On Tue, May 24, 2011 at 3:18 PM, John Bresnahan < <a href="mailto:bresnaha@mcs.anl.gov" target="_blank">bresnaha@mcs.anl.gov</a><br></div><div><div></div><div class="h5">
    <mailto:<a href="mailto:bresnaha@mcs.anl.gov" target="_blank">bresnaha@mcs.anl.gov</a>> > wrote:<br>
<br>
<br>
    The GPFS server on the FG cluster hotel died yesterday so I cannot get you your credentials.<br>
      I'll get back to you when it is up again.  Once it is back the process for getting the needed<br>
    access keys is described here:<br>
<br>
    <a href="https://portal.futuregrid.org/tutorials/nimbus" target="_blank">https://portal.futuregrid.org/tutorials/nimbus</a><br>
<br>
<br>
<br>
<br>
    On 05/23/2011 05:24 AM, David Kelly wrote:<br>
<br>
<br>
<br>
<br>
<br>
    Hi John,<br>
<br>
    I now have a futuregrid account and am added to a project. I am now trying to get our scripts<br>
    working together.<br>
<br>
    I ran into a few problems at first when trying to run the futuregrid scripts. On the first system I<br>
    tried I was getting a traceback. It is possible that the system I was using has older versions of<br>
    some of the needed libraries. Then I tried it on a more system that is more frequently updated - my<br>
    laptop running Ubuntu 10.10.  It needed a newer version of the Python crypto tools installed, so I<br>
    installed that (and the python development libraries) and that part seems fine now.<br>
<br>
    I am now up to the point of the install script where it is trying to register keys, but it is<br>
    failing. My guess is that I need to change FUTUREGRID_IAAS_ACCESS_KEY and FUTUREGRID_IAAS_SECRET_KEY<br>
    in env.sh. I'm not sure what these should be exactly. Are these the contents of my ssh keys, an ssh<br>
    key and a passphrase, or some other type of security? I've tried a few combinations of different<br>
    things but haven't had much luck yet.<br>
<br>
    Thanks!<br>
<br>
    Regards,<br>
    David<br>
<br>
<br>
    Traceback from earlier:<br>
    Installing setuptools.......................done.<br>
       Complete output from command /autonfs/home/davidk/swift-vm-...ython<br>
    /autonfs/home/davidk/swift-vm-...stall pip:<br>
       Searching for pip<br>
    Reading <a href="http://pypi.python.org/simple/pip/" target="_blank">http://pypi.python.org/simple/pip/</a><br>
    Reading <a href="http://pip.openplans.org" target="_blank">http://pip.openplans.org</a><br>
    Reading <a href="http://www.pip-installer.org" target="_blank">http://www.pip-installer.org</a><br>
    Best match: pip 1.0.1<br>
    Downloading<br>
    <a href="http://pypi.python.org/packages/source/p/pip/pip-1.0.1.tar.gz#md5=28dcc70225e5bf925532abc5b087a94b" target="_blank">http://pypi.python.org/packages/source/p/pip/pip-1.0.1.tar.gz#md5=28dcc70225e5bf925532abc5b087a94b</a><br>

    Processing pip-1.0.1.tar.gz<br>
    Running pip-1.0.1/setup.py -q bdist_egg --dist-dir<br>
    /tmp/easy_install-GHsjHX/pip-1.0.1/egg-dist-tmp-rXjQ7L<br>
    Traceback (most recent call last):<br>
       File "/autonfs/home/davidk/swift-vm-boot/ve/bin/easy_install", line 8, in <module><br>
         load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()<br>
       File<br>
    "/autonfs/home/davidk/swift-vm-boot/ve/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py",<br>
    line 1712, in main<br>
       File<br>
    "/autonfs/home/davidk/swift-vm-boot/ve/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py",<br>
    line 1700, in with_ei_usage<br>
       File<br>
    "/autonfs/home/davidk/swift-vm-boot/ve/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py",<br>
    line 1716, in <lambda><br>
       File "/soft/python-2.6.1-r1/lib/python2.6/distutils/core.py", line 152, in setup<br>
         dist.run_commands()<br>
       File "/soft/python-2.6.1-r1/lib/python2.6/distutils/dist.py", line 975, in run_commands<br>
         self.run_command(cmd)<br>
       File "/soft/python-2.6.1-r1/lib/python2.6/distutils/dist.py", line 995, in run_command<br>
         cmd_obj.run()<br>
       File<br>
    "/autonfs/home/davidk/swift-vm-boot/ve/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py",<br>
    line 211, in run<br>
       File<br>
    "/autonfs/home/davidk/swift-vm-boot/ve/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py",<br>
    line 446, in easy_install<br>
       File<br>
    "/autonfs/home/davidk/swift-vm-boot/ve/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py",<br>
    line 476, in install_item<br>
       File<br>
    "/autonfs/home/davidk/swift-vm-boot/ve/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py",<br>
    line 655, in install_eggs<br>
       File<br>
    "/autonfs/home/davidk/swift-vm-boot/ve/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py",<br>
    line 930, in build_and_install<br>
       File<br>
    "/autonfs/home/davidk/swift-vm-boot/ve/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py",<br>
    line 919, in run_setup<br>
       File<br>
    "/autonfs/home/davidk/swift-vm-boot/ve/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/sandbox.py",<br>
    line 52, in run_setup<br>
    AttributeError: 'module' object has no attribute '__getstate__'<br>
    ----------------------------------------<br>
    Traceback (most recent call last):<br>
       File "bin/virtualenv.py", line 1647, in <module><br>
         main()<br>
       File "bin/virtualenv.py", line 558, in main<br>
         prompt=options.prompt)<br>
       File "bin/virtualenv.py", line 656, in create_environment<br>
         install_pip(py_executable)<br>
       File "bin/virtualenv.py", line 415, in install_pip<br>
         filter_stdout=_filter_setup)<br>
       File "bin/virtualenv.py", line 624, in call_subprocess<br>
         % (cmd_desc, proc.returncode))<br>
    OSError: Command /autonfs/home/davidk/swift-vm-...ython /autonfs/home/davidk/swift-vm-...stall pip<br>
    failed with error code 1<br>
    Failed to created the needed python virtual environment<br>
<br>
    On Fri, May 20, 2011 at 7:20 PM, John Bresnahan < <a href="mailto:bresnaha@mcs.anl.gov" target="_blank">bresnaha@mcs.anl.gov</a><br></div></div>
    <mailto:<a href="mailto:bresnaha@mcs.anl.gov" target="_blank">bresnaha@mcs.anl.gov</a>> <mailto: <a href="mailto:bresnaha@mcs.anl.gov" target="_blank">bresnaha@mcs.anl.gov</a> <mailto:<a href="mailto:bresnaha@mcs.anl.gov" target="_blank">bresnaha@mcs.anl.gov</a>> >><div>
<div></div><div class="h5"><br>
<br>
<br>
<br>
    wrote:<br>
<br>
        Our phone call today left me motiviated to show you guys how easy it is to get virtual machines<br>
        for use with swift on FutureGrid.<br>
<br>
        I made some small scripts around the Nimbus tool cloudinitd.  The scripts just make installing<br>
        the software and running it trivial.  With a single command you can get N VMs from the<br>
        FutureGrid Nimbus clouds (N can be on the order of hundreds).  When the tool is done it outputs<br>
        a line separated list of hostnames.  All of these hostnames have root access available via your<br>
        ~/.ssh/id_rsa keys.<br>
<br>
        If/when you have FutureGrid credentials, untar the attachment and give it a try.  There are a<br>
        few minor configurations needed:<br>
<br>
<br>
        1) edit the file env.sh and set your FutureGrid security credentials:<br>
<br>
        % cat env.sh<br>
        export FUTUREGRID_IAAS_ACCESS_KEY=XXXXXXXXXXXXXXXXXX<br>
        export FUTUREGRID_IAAS_SECRET_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br>
<br>
        export FUTUREGRID_HOTEL_NODES=2<br>
        export FUTUREGRID_SIERRA_NODES=2<br>
<br>
        You can also change the value '2' to be whatever number of VMs you want.<br>
<br>
<br>
        2) install it on your system.  (this single command downloads and installs everything you need<br>
        under the cwd):<br>
<br>
        % ./install.sh<br>
<br>
        3) boot the VMs<br>
        % ./bin/bootit.sh.<br>
    You will see much status output, but the last several lines will be the hostnames acquired from<br>
        the cloud.<br>
<br>
        Let me know when you guys are ready to check this out!<br>
<br>
<br>
<br>
<br>
<br>
</div></div></blockquote>
<br>
</blockquote></div><br></div></div></div>