uniquely identify an OS instance - Unix

This is a discussion on uniquely identify an OS instance - Unix ; Hi, i work on a utility which gives an unique id to the host. it generates an UUID and stores it in /etc. now the problem is that if the system is cloned (disk cloning) and the image is used ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: uniquely identify an OS instance

  1. uniquely identify an OS instance

    Hi,

    i work on a utility which gives an unique id to the host. it generates
    an UUID and stores it in /etc.

    now the problem is that if the system is cloned (disk cloning) and the
    image is used to setup a new host then the utility doesn't generate a
    new UUID as the UUID is already present in /etc.

    somehow the utility should know that it is now running in a cloned
    environment and generate a new UUID.

    initially i thought of storing a combination of IP address and MAC
    address. but what if someone adds a new network card or changes
    existing network card or the ip changes in case of DHCP.

    so is there some unique id or info for an OS which i can rely on?

    i checked hostid command but its based on IP address...

    Also, the utility is ported on most of the UNIX platforms like Linux,
    Solaris, HP-UX, OSF, IRIX and AIX.

    any help is appreciated.



    Thanks,
    mrc


  2. Re: uniquely identify an OS instance

    Begin <172d9797-f5cb-400d-99cf-e34b13c2ac0b@q24g2000prf.googlegroups.com>
    On Sat, 7 Jun 2008 01:02:57 -0700 (PDT), mrc wrote:
    > now the problem is that if the system is cloned (disk cloning) and the
    > image is used to setup a new host then the utility doesn't generate a
    > new UUID as the UUID is already present in /etc.
    >
    > somehow the utility should know that it is now running in a cloned
    > environment and generate a new UUID.


    How do you suppose it *can* know that, other than by being told?


    I'd suggest clonning the image before that utility is run.


    > Also, the utility is ported on most of the UNIX platforms like Linux,
    > Solaris, HP-UX, OSF, IRIX and AIX.


    So, how does it do that on those other platforms?


    --
    j p d (at) d s b (dot) t u d e l f t (dot) n l .
    This message was originally posted on Usenet in plain text.
    Any other representation, additions, or changes do not have my
    consent and may be a violation of international copyright law.

  3. Re: uniquely identify an OS instance

    jpd, thanks for replying.

    > How do you suppose it *can* know that, other than by being told?


    for eg. in case of windows platform, by checking the windows SID
    (http://www.pluralsight.com/wiki/defa...ith.GuideBook/
    WhatIsASID.html) for a user/group it can get the unique machine id.
    the SID in case of windows is based on a unique 32-bit machine id.
    when a windows OS is cloned the new OS instance gets a new SID by
    running sysprep utility. all disk cloning products take care of
    running sysprep. my utility can check the SID to know if its running
    in a cloned environment.

    on UNIX i am looking for some info like above for me to rely on.

    >
    > I'd suggest clonning the image before that utility is run.


    my utility is installed on the box so it is up to the user to decide
    whether to run it before taking image or after wards. i don't want to
    restrict the user.

    > So, how does it do that on those other platforms?


    sorry for the confusion i wanted to say that i need something which is
    common for all UNIX flavors. now it fails in cloned environment for
    all the above platforms.


    i am trying to get info on the 'post-cloning operations on UNIX'. if
    anyone has pointers on that then please share.

    i know that now a days devices are assigned UUID but i cant rely on
    them as they are replaceable.



    Thanks,
    mrc


  4. Re: uniquely identify an OS instance

    Begin <036a11e8-fd44-4d0d-a7f5-031652054668@a9g2000prl.googlegroups.com>
    On Sat, 7 Jun 2008 01:31:47 -0700 (PDT), mrc wrote:
    > i am trying to get info on the 'post-cloning operations on UNIX'. if
    > anyone has pointers on that then please share.


    Ah, right. This is sufficiently system-dependent that it is safe to
    say there is no general works-on-all-unices solution.

    Worse, since you can clone a system by using standard tools like dd,
    tar, and the like, there is no standard hook to hang this operation on;
    ``the user'' (in casu usually ``the sysadmin'', which does have impact
    on how you should treat the matter) can and often enough does roll his
    own solution. So at the very least you'll be stuck documenting your
    requirement and providing documentation on how to use your tool.

    For further pointers, you might have a look at the _rosetta stone for
    unix_[1], notably the ``unique ID useful for licensing'' row. As you can
    see, it is far from complete.


    [1] http://bhami.com/rosetta.html

    --
    j p d (at) d s b (dot) t u d e l f t (dot) n l .
    This message was originally posted on Usenet in plain text.
    Any other representation, additions, or changes do not have my
    consent and may be a violation of international copyright law.

  5. Re: uniquely identify an OS instance

    mrc writes:
    >jpd, thanks for replying.


    >> How do you suppose it *can* know that, other than by being told?


    >for eg. in case of windows platform, by checking the windows SID
    >(http://www.pluralsight.com/wiki/defa...ith.GuideBook/
    >WhatIsASID.html) for a user/group it can get the unique machine id.
    >the SID in case of windows is based on a unique 32-bit machine id.
    >when a windows OS is cloned the new OS instance gets a new SID by
    >running sysprep utility. all disk cloning products take care of
    >running sysprep. my utility can check the SID to know if its running
    >in a cloned environment.


    >on UNIX i am looking for some info like above for me to rely on.


    You could have Windows systems with the same SID if they get cloned,
    its just that MS has taken pains to pound it through everybody that
    its bad practice, and made sure that in a networked A/D environment
    that this is a very bad undesireable thing.

    The Unix world hasn't taken these steps.

    hostid on Solaris SPARC systems are unique, even if they get cloned.

    Unfortunatly, Solaris x86 doesn't have the hardware again, and it can
    get cloned and hostid could be the same on two systems (although they
    are unique on two seperately installed systems).

    There's not going to be a portable method across all OSs. Ethernet MAC
    address is going to be your most portable method.

    If this is so critical, you could provide the hardware that makes it
    unique (ie. USB dongle).




  6. Re: uniquely identify an OS instance

    In article
    <172d9797-f5cb-400d-99cf-e34b13c2ac0b@q24g2000prf.googlegroups.com>,
    mrc wrote:

    > Hi,
    >
    > i work on a utility which gives an unique id to the host. it generates
    > an UUID and stores it in /etc.
    >
    > now the problem is that if the system is cloned (disk cloning) and the
    > image is used to setup a new host then the utility doesn't generate a
    > new UUID as the UUID is already present in /etc.
    >
    > somehow the utility should know that it is now running in a cloned
    > environment and generate a new UUID.
    >
    > initially i thought of storing a combination of IP address and MAC
    > address. but what if someone adds a new network card or changes
    > existing network card or the ip changes in case of DHCP.


    Maybe when it notices the mismatch, it could ask the user if the system
    has been cloned or the network card replaced. If the card was replaced
    it would leave the UUID alone, if the machine has been cloned it would
    generate a new one.

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    *** PLEASE don't copy me on replies, I'll read them in the group ***

+ Reply to Thread