Change hostid to particullar string | Unix Linux Forums | Red Hat

  Go Back    


Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

Change hostid to particullar string

Red Hat


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-23-2013
brusell's Avatar
brusell brusell is offline
Registered User
 
Join Date: Oct 2009
Last Activity: 19 May 2014, 6:24 AM EDT
Location: Germany
Posts: 91
Thanks: 11
Thanked 3 Times in 3 Posts
Change hostid to particullar string

Hello guys,
currently I'm working on migration services from physical to virtual server (RHEL 6). One form applications is binded to hostid of old server.
I put value of hostid from old server to the /etc/hostid on new server, but output of hostid command is giving nonsenses then.

Code:
[root@oldserver ~]# hostid 
17acc883



Code:
[root@newserver tmp]# hostid 
18ac2644
[root@newserver tmp]# echo 17acc883 > /etc/hostid
[root@newserver tmp]# hostid 
63613731

Can anybody help??

Thanks.

---------- Post updated at 12:50 ---------- Previous update was at 12:37 ----------

So I have found solution.


Code:
#!/usr/bin/python
from struct import pack
hostid = pack("I",int("0x210a2500",16))
filename = "/etc/hostid"
open(filename,"wb").write(hostid)

The Following User Says Thank You to brusell For This Useful Post:
rkhyd (06-03-2014)
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How can I change hostid? getrue Red Hat 4 07-24-2012 05:24 PM
How to change hostid saved in rpool? aixlover Solaris 21 02-28-2012 10:28 AM
Change Solaris hostid avisht Solaris 21 12-21-2010 08:50 AM
procedure to change hostid of Sun server girish.batra Solaris 4 02-11-2009 02:21 AM
How to change the HostID?--SunFire880 surainbow Solaris 2 07-21-2008 11:15 PM



All times are GMT -4. The time now is 02:12 PM.