How can I determine which computer a share is connected to in /Volumes from terminal or a script?

I run a set of virtual machines via Fusion on an iMac that we run automated tests on for our website.  There is a folder on each VM called /Automation that is shared. 
I have a python script that runs on the host, that will find an open VM, start it up and then mount the VM's /Automation folder.  So if there is only 1 VM powered on, the folder shows up in /Volumes as /Volumes/Automation.  The  problem is when there are 2 or more VM's powered on, because then the shares start being named /Volumes/Automation-1 and Automation-2 etc.  So my question is, how can I determine which computer each share belongs to from terminal or a script?
In other words, I'm looking for something like:
/Volumes/Automation = "FirstVirtualMachineName.local"
/Volumes/Automation-1 = "SecondVirtualMachineName.local"
Is there any way to determine which computer a mounted share is connected to?  In the past, I've just unmounted all /Automation folders, and then mounted them in a particular order, but that's unreliable and messy in my opinion.  If anyone knows a better way, please let me know.  Any help is appreciated.
Thanks,

Well I think I have a workable solution.  It's not perfect, but I think it will do the trick. I can put a spotlight comment on the folder similar to 'HostName=OSX-Automation-1.local' and can then retrieve that value from our server with the following python snippet:
import subprocess
out,err = subprocess.Popen(['osascript','-e','tell application \"Finder\" to get comment of \"Macintosh HD:Volumes:Automation-1\"'],stdout=subprocess.PIPE, stderr=subprocess.PIPE).communciate()
So I could just loop through each 'Automation*' folder in /Volumes and grab the name from the spotlight attributes on the directories.  I don't think I really need to worry about the comments being overwritten, but I may have one of our launch daemons that run on the VM check that spotlight comment once a minute or something to ensure that the correct value is there.
If it ends up not working well in practice, I'm going to give your suggestion about a config script a shot.  It would require a little more up front work, but seems as if it would be pretty solid after that. 
Thanks again for helping me think it through

Similar Messages

  • How can you tell which computer that is authorized as the master?

    I have several computers that I have connected my iPhone to. How can I tell which computer I should connect to before updating the operating system? I don't want to loss data if I don't have to.

    I am not that familiar with Apple and iTunes and was getting help from someone who said that I can plug my iPhone into my computers but that I would have to authorize the iPhone on each but the limit is 5.
    This is not accurate.
    You can authorize up to 5 computers with the same iTunes account. There is no device limit for the number of iPods, iPads, and iPhones that can be synced with the same iTunes library and iTunes account on the same computer.
    An iPhone can be synced with an iTunes library on one computer only, and photos can be transferred from one computer only. When transferring iTunes content and photos from another computer, all iTunes content and photos transferred from a different computer will be erased from the iPhone first.
    This is why I asked - you have connected your iPhone to each one of these computers for what?
    I was not sure which computer I first used. Is there a simple way to check?
    No, or I would have provided that with my first reply.
    If you connect your iPhone to a "non-master" computer to install the update, you will be provided a warning.
    How many computers are you talking about? If 5 or less, this should take you no more than 10 minutes to determine which computer you transferred music and photos from.

  • I have about 5,000 images in a Folder.  How can I determine which images are NOT in a Collection?

    I have about 5,000 images in a Folder.  How can I determine which images are NOT in a Collection?

    Create a smart collection with criteria "collection" and "does not contain"; and also with criterion Folder contains (or folder contains all)
    That works if you are thinking about a specific named collection.
    If you are interested in finding photos that are not in ANY collection, the usual trick is "collection" "does not contain" "a e i o u y"

  • How does DIADEM import TDMS files? How gets every channel his number and groupindex? How can I determine which channel has which groupindex and number?

    I store different channels in a TDMS file.
    I like to have a time channel at the first position with group index 1 and number 1.
    When I read the TDMS file with DIADEM the time channel (Float64) is on a differernt position, and the channels are not sorted alphabetically.
    Here are my questions:
    How does DIADEM import TDMS files?
    How gets every channel his number and groupindex?
    How can I determine which channel has which groupindex and number?
    Best regards
    Joerg

    Hi Jörg,
    i suppose that you´re programme whose create the *.tdms file is writing on false position. Try to create datas with timechannel on first indes in diadem, then save it and then open it again. you see that all is correct. So please tell me what programm in what version do you use and please attache it here.
    Did you use the library for creating *.tdms files like in the link ?
    http://zone.ni.com/devzone/cda/tut/p/id/6471
    Here you find the gtdms_8.x.zip - when you extract it and opened the *.llb you find vi´s for all functions e.g. writing 2d array of strings to *.tdms file
    when you open the subvi´s then you see how created and writing datas/structure to *.tdms files. Because *.tdms is binary you can´t see structure with open it in editor.
    When you don´t have Labview you can use the 30 days test of current version 8.5 under following link
    german version download link
    https://lumen.ni.com/nicif/d/lveval/content.xhtml
    english version download link
    https://lumen.ni.com/nicif/us/lveval/content.xhtml
    Hope it helps
    Best Regards

  • How can I change which computer taht is my main?

    How can I change which computer that is my main without loosing all my APPS, all my music etc when I sync?
    When I first used my iPhone i was on my work computer, but now I can't sync it on my home computer without loosing all data? That isn't a good design solution at all.
    Is there any way to change the authentication from my work computer to my home?
    There should really be a better way to solve this, instead of forcing alot of users to "Choose" only 1 computer, I mean I believe many have maybe 2 or 3 computers that they want to use there iDevices on... Please help me!
    /Henric

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • How can I determine which machines have activated Adobe Acrobat Standard 9?

    How can I determine which machines have activated Adobe Acrobat Standard 9?

    Hi jrector3,
    You need to go to the respective machines and launch Acrobat and check if it prompts for serial number.
    You can also go to the help menu and check if 'Deactivate' option is highlighted.
    Regards,
    Rave

  • How can I determine which image was clicked in 3D carousel?

    I have been modifying some 3D carousel code that I found in hopes that I can get it such that when image "resolv2.jpg" (or any of my other images) is clicked on at the front of my carousel, it goes to a specific webpage. By just replacing "moveBack(event.target) from the toggler section of the code with "navigateToURL:(newURLRequest('http://google.com'), the target DOES sucessfully go to google when clicked on. However, I want to modify this code by altering the else statement to say something to the effect of "else if event.target (clicked on object) is 'resolv2.jpg' THEN go to google". So essentially, my question is how can I determine which image was clicked? Here is the entire code with the area I was altering bolded:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" applicationComplete="init();" backgroundGradientColors="[#000033, #000033]" backgroundGradientAlphas="[1.0, 1.0]">
    <mx:Script>
              <![CDATA[
    //Import Papervision Classes
                   import org.papervision3d.scenes.*;
                   import org.papervision3d.cameras.*; 
                   import org.papervision3d.objects.*;
                   import org.papervision3d.objects.primitives.*;
                   import org.papervision3d.materials.*;
                   import org.papervision3d.materials.shadematerials.*;
                   import org.papervision3d.materials.utils.MaterialsList;
                   import org.papervision3d.lights.*;
                   import org.papervision3d.render.*;
                   import org.papervision3d.view.*;
                   import org.papervision3d.events.*;
                   import org.papervision3d.core.*;
                   import org.papervision3d.lights.PointLight3D;
                   import flash.filters.DropShadowFilter;
                         import caurina.transitions.*;
                         private var numOfItems:int = 5;
                         private var radius:Number = 600;
                         private var anglePer:Number = (Math.PI*2) / numOfItems;
                         //private var dsf:DropShadowFilter = new DropShadowFilter(10, 45, 0x000000, 0.3, 6, 6, 1, 3);
                   public var angleX:Number = anglePer;
             public var dest:Number = 1;
                   private var theLight:PointLight3D;
            //Papervision Engine
                   private var viewport:Viewport3D; 
                   private var scene:Scene3D; 
                   private var camera:Camera3D;
                   private var renderer:BasicRenderEngine;
             private var planeArray:Array = new Array();
             [Bindable]
             public var object:Object;
             private var arrayPlane:Object;
             private var p:Plane;
             //Initiation function           
             private function init():void 
             viewport = new Viewport3D(pv3dCanvas.width, pv3dCanvas.height, false, true); 
             pv3dCanvas.rawChildren.addChild(viewport); 
             viewport.buttonMode=true;
             renderer = new BasicRenderEngine();
             scene = new Scene3D(); 
             camera = new Camera3D();
             camera.zoom = 2; 
             createObjects(); 
             addEventListeners();
    //Create Objects function          
              private function createObjects():void{
              for(var i:uint=1; i<=numOfItems; i++)
                        /* var shadow:DropShadowFilter = new DropShadowFilter();
                        shadow.distance = 10;
            shadow.angle = 25; */
                        var bam:BitmapFileMaterial = new BitmapFileMaterial("images/resolv"+i+".jpg");
                        bam.oneSide = false;
                        bam.smooth = true;
            bam.interactive = true;
                        p = new Plane(bam, 220, 200, 2, 2);
                        p.x = Math.cos(i*anglePer) * radius;
                        p.z = Math.sin(i*anglePer) * radius;
                        p.rotationY = (-i*anglePer) * (180/Math.PI) + 270;
                        scene.addChild(p);
                        //p.filters=[shadow];
                        p.extra={pIdent:"in"};
                        p.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, toggler);
            planeArray[i] = p;
              // create lighting
            theLight = new PointLight3D();
            scene.addChild(theLight);
            theLight.y = pv3dCanvas.height;
              private function toggler(event:InteractiveScene3DEvent):void
                            // if the cube's position is "in", move it out else move it back
                            if (event.target.extra.pIdent == "in")
                                    moveOut(event.target);
                            else
                                   moveBack(event.target);
                    private function moveOut(object:Object):void
                              trace(object +" my object");
                            // for each cube that was not selected, remove the click event listener
                            for each (var arrayPlane:Object in planeArray)
                                    if (arrayPlane != object)
                                            arrayPlane.removeEventListener(InteractiveScene3DEvent.OBJECT_PRESS, toggler);
                            //right.enabled=false;
                            //left.enabled=false;
                            // move the selected cube out 1000 and rotate 90 degrees once it has finished moving out
                            Tweener.addTween(object, {scaleX:1.2, time:0.5, transition:"easeInOutSine", onComplete:rotateCube, onCompleteParams:[object]});
                            Tweener.addTween(object, {scaleY:1.2, time:0.5, transition:"easeInOutSine", onComplete:rotateCube, onCompleteParams:[object]});
                            // set the cube's position to "out"
                            object.extra = {pIdent:"out"};
                            // move the camera out 1000 and move it the to same y coordinate as the selected cube
                            //Tweener.addTween(camera, {x:1000, y:object.y, rotationX:0, time:0.5, transition:"easeInOutSine"});
                    private function moveBack(object:Object):void
                            // for each cube that was not selected, add the click event listener back
                            for each (var arrayPlane:Object in planeArray)
                                    if (arrayPlane != object)
                                            arrayPlane.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, toggler);
                            // move the selected cube back to 0 and rotate 90 degrees once it has finished moving back
                            Tweener.addTween(object, {scaleX:1, time:0.5, transition:"easeInOutSine", onComplete:rotateCube, onCompleteParams:[object]});
                            Tweener.addTween(object, {scaleY:1, time:0.5, transition:"easeInOutSine", onComplete:rotateCube, onCompleteParams:[object]});
                            // set the cube's position to "in"
                            object.extra = {pIdent:"in"};
                            // move the camera back to its original position
                            //Tweener.addTween(camera, {x:0, y:1000, rotationX:-30, time:0.5, transition:"easeInOutSine"});
                            //right.enabled=true;
                            //left.enabled=true;
                    private function goBack():void
                            // for each cube that was not selected, add the click event listener back
                            for each (var arrayPlane:Object in planeArray)
                                    if (arrayPlane != object)
                                            arrayPlane.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, toggler);
                    private function rotateCube(object:Object):void
                            //object.rotationX = 0;
                            //Tweener.addTween(object, {rotationZ:0, time:0.5, transition:"easeOutSine"});
              private function addEventListeners():void{
        this.addEventListener(Event.ENTER_FRAME, render);
    //Enter Frame Listener function             
    private function render(e:Event):void{ 
                     renderer.renderScene(scene, camera, viewport);
                     camera.x = Math.cos(angleX) * 800;                                                  
                     camera.z = Math.sin(angleX) * 800;
    private function moveRight():void
              dest++;
              Tweener.addTween(this, {angleX:dest*anglePer, time:0.5});
              //goBack();
    private function moveLeft():void
              dest--;
              Tweener.addTween(this, {angleX:dest*anglePer, time:0.5});
              //goBack();
              ]]>
    </mx:Script>
              <mx:Canvas width="1014" height="661">
              <mx:Canvas id="pv3dCanvas" x="503" y="20" width="400" height="204" borderColor="#110101" backgroundColor="#841414" alpha="1.0" backgroundAlpha="0.57"> 
              </mx:Canvas>
              <mx:Button x="804" y="232" label="right" id="right" click="moveRight(),goBack()"/>
              <mx:Button x="582" y="232" label="left"  id="left"  click="moveLeft(),goBack()" />
              </mx:Canvas>
    </mx:Application>

    Your answer may be correct, but I am very much a beginner to actionscript, and I was wondering moreso if it is possible to determine the root/url (i.e. images/resolv2.jpg)? Or even if InteractiveScene3DEvent calls a variable that holds this url? However, specifically, I'm just wondering if the actionscript itself could determine the url in a line of code such as "if object == BitmapFileMaterial("/images/resolv2.jpg"); "? Also, here's a copy of InteractiveScene3DEvent in more detail if you think that will help:
    public class InteractiveScene3DEvent extends Event
                         * Dispatched when a container in the ISM recieves a MouseEvent.CLICK event
                        * @eventType mouseClick
                        public static const OBJECT_CLICK:String = "mouseClick";
                         * Dispatched when a container in the ISM receives an MouseEvent.MOUSE_OVER event
                        * @eventType mouseOver
                        public static const OBJECT_OVER:String = "mouseOver";
                         * Dispatched when a container in the ISM receives an MouseEvent.MOUSE_OUT event
                        * @eventType mouseOut
                        public static const OBJECT_OUT:String = "mouseOut";
                         * Dispatched when a container in the ISM receives a MouseEvent.MOUSE_MOVE event
                        * @eventType mouseMove
                        public static const OBJECT_MOVE:String = "mouseMove";
                         * Dispatched when a container in the ISM receives a MouseEvent.MOUSE_PRESS event
                        * @eventType mousePress
                        public static const OBJECT_PRESS:String = "mousePress";
                         * Dispatched when a container in the ISM receives a MouseEvent.MOUSE_RELEASE event
                        * @eventType mouseRelease
                        public static const OBJECT_RELEASE:String = "mouseRelease";
                         * Dispatched when the main container of the ISM is clicked
                        * @eventType mouseReleaseOutside
                        public static const OBJECT_RELEASE_OUTSIDE:String = "mouseReleaseOutside";
                         * Dispatched when a container is created in the ISM for drawing and mouse interaction purposes
                        * @eventType objectAdded
                        public static const OBJECT_ADDED:String = "objectAdded";
                        public var displayObject3D                                        :DisplayObject3D = null;
                        public var sprite                                                            :Sprite = null;
                        public var face3d                                                            :Triangle3D = null;
                        public var x                                                                      :Number = 0;
                        public var y                                                                      :Number = 0;
                        public var renderHitData:RenderHitData;
                        public function InteractiveScene3DEvent(type:String, container3d:DisplayObject3D=null, sprite:Sprite=null, face3d:Triangle3D=null,x:Number=0, y:Number=0, renderhitData:RenderHitData = null, bubbles:Boolean=false, cancelable:Boolean=false)
                                  super(type, bubbles, cancelable);
                                  this.displayObject3D = container3d;
                                  this.sprite = sprite;
                                  this.face3d = face3d;
                                  this.x = x;
                                  this.y = y;
                                  this.renderHitData = renderhitData;
    Thank you so much!

  • How can I determine which generation my iPod is?

    How can I determine which generation my IPod touch is? I have a new sound system that is only compatible with 5th gen. When I went out to add this device to the support community's list of my devices, it only gave me ipos 5 to add. Can I rely on this?

    Identifying iPod models
    The 5G is the first iPod to have the taller screen and the small Ligntning dock connector vice the large 30 pin connector

  • How can I determine which profile Firefox 5 is currently using?

    How can I determine which profile Firefox 5 is currently using?

    in address bar type:
    '''''about:cache'''''
    and look at '''''Offline cache device -> Cache Directory'''''

  • How can I determine which generation ipad I have?

    how can I determine which generation ipad I have. It was a gift last year.

    Click here for information.
    (73309)

  • How can I determine which generation my Apple TV device is ?

    How can I determine which generation my Apple TV device is?

    Models
    1st generation
    2nd generation
    3rd generation
    3rd generation Rev A
    Release date(s)
    January 9, 2007
    September 1, 2010
    March 7, 2012
    January 28, 2013
    Discontinued
    September 1, 2010
    March 7, 2012
    March 10, 2013[69]
    In production
    Model Number - Model ID - Order Number
    A1218 - AppleTV1,1 - MA711LL/A
    A1378 - AppleTV2,1 - MC572LL/A
    A1427 - AppleTV3,1 - MD199LL/A
    A1469 - AppleTV3,2 - MD199LL/A

  • HT201250 How can I determine which Time Machine backups can be deleted to free space on my backup device?

    Time Machine keeps hourly backups for the past 24 hours, daily backups for the past month, and weekly backups.
    But are they all incremental or full backups?
    How can I determine which can be deleted to free space on my backup device?
    Thanks.

    Thanks.
    So, if TimeMachine only makes one full backup the first time a backup is taken, and then automatically removes backups as space is needed, is there a danger that there can come a point where no single restore point exists?
    I find Apple's lack of detail around this topic disappointing. It's such an important thing.
    I guess TimeMachine doesn't work quite how I want it too. Seems to be true of so many Apple products!

  • How can I determine which Layout Designer documents go with a business part

    How can I determine which Layout Designer documents go with a business parter?  I need to be able to query the database and make sure the right business partners are assigned to the right Layout Designer documents without going into the Layout Designer.
    TJA

    Hi,
    You may check this thread:
    Print Layouts related to Business Partners
    Thanks,
    Gordon

  • How can I determine which jobs are running on NT?

    Hello,
    How do I determine which processes are in execution on an NT box from a JAVA
    application? I figure it must involve runtime exec'ing some run32dll
    program, but which one?
    TIA

    Search microsoft.com, or MSDN. That isn't anything to do with Java Programming.

  • How can I determine which browser is used(Microsoft IE or Netscape)

    As you probely know: Netscape doesn't support the same functionality as IE.
    To gain the maxium functionality from IE without solving problems in Netscape, the customer has decided to work with two different stylesheets(one for IE and one for Netscape).
    Now my question is, how can I determine in Portal in which browser(IE or Netscape) it is running.
    Thanks
    arny
    Therefor we are using two differen

    The browser ID string is a HTTP request parameter. How you get to it depends entirely on what you're programming in. You want to get the value of the User-Agent parameter (for example, in CGI, this is HTTP_USER_AGENT).
    However, I'd advise against doing things this way unless you really understand how HTTP works on many levels. One common problem people run into on sending different content based on the browser is that proxy servers will happily cache everything and send content intended for one browser to another.
    I have not seen any IE functionality that Netscape does not also have that is worth this hassle, but that's just my very stubborn opinion. :-)

Maybe you are looking for

  • SelectOneChoice not showing all values from database

    Hi! I have to put a list of values in my select one choice. When I do the query in database, all the values are selected. But, with the same query on JPQL, the select on choice do not show all values in database. Anyone can help me, please? P.S.: I a

  • Problem in compiling oracle 8i procedures

    Hi Rupinder, I have a complex problem and need your help in fixing it. I'm trying to setup our test environment (Application & database) both in Pentium 4 desktop. The platform is windows 2003 server installed in the desktop without any problem and u

  • Two important problems with GWIA

    I have two major problems in GroupWise 8 SP2 with the latest HP. First, something I arose at another facility with HP2 and that in this new server with HP3 still happens, the file is lost gwac.db every 5 days at 0 hours exactly. Something I could fix

  • How to fill the details tab in the iPad tv shows with description

    Can anyone tell how to fill out the details tab metadata in the tv shows section of iPad? The tv shows purchased from the iTunes Store have the details tab beside the episodes tab filled in with helpful description about the show. Isn't there a way t

  • Where is the asper measurement in Sound and Vibration assistant

    I did a test drive of the Sound and Vibration Suite, liked what it could do, but could only afford the Toolkiit. Now I can't find the Asper (Roughness) measurement in the Toolkit. Is it there? I found the Loudness, Sharpness, etc.