OpenVZ Forum


Home » Mailing lists » Users » How to identify the physical machine when you are inside the container?
Re: How to identify the physical machine when you are inside the container? [message #42691 is a reply to message #42646] Wed, 11 May 2011 20:08 Go to previous message
Thorsten Schifferdeck is currently offline  Thorsten Schifferdeck
Messages: 38
Registered: February 2006
Member
Hi,

you can use action scripts mount, see OpenVZ User Guide,
p. 89 (-> http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf )
or man page vzctl (8)

on ct mount, a ct0 hostname info is writen inside the ct, like:


---8<... ...( file: /etc/vz/conf/vps.mount )...
#!/bin/bash

# global vps.mount script
# write hostname ct0 info from ct0 to ctX

# include the ct config
. $VE_CONFFILE

hostname > $VE_PRIVATE/_to/any/place/where/you/like/it_

exit 0
---8<...

Bye,
Thorsten

Am 09.05.2011 10:13, schrieb Benjamin Henrion:
> Hi,
>
> Do you have any trick to identify the physical machine (with some kind
> of cat /proc/something) when you are inside the container?
>
> I want to just get the hostname of the HN when I am inside the containers.
>
> Any simple of doing it?
>
> Best,
>
> --
> Benjamin Henrion <bhenrion at ffii.org>
> FFII Brussels - +32-484-566109 - +32-2-4148403
> "In July 2005, after several failed attempts to legalise software
> patents in Europe, the patent establishment changed its strategy.
> Instead of explicitly seeking to sanction the patentability of
> software, they are now seeking to create a central European patent
> court, which would establish and enforce patentability rules in their
> favor, without any possibility of correction by competing courts or
> democratically elected legislators."
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: /usr/sbin/vzmigrate: line 312: vzctl: command not found
Next Topic: Slackware 13 weirdness
Goto Forum:
  


Current Time: Tue Aug 12 09:39:55 GMT 2025

Total time taken to generate the page: 0.59357 seconds