Operating System - HP-UX
1825667 Members
3858 Online
109686 Solutions
New Discussion

Checking if a HP-UX system is virtual or not

 
SOLVED
Go to solution
Vineet Deshpande
Frequent Advisor

Checking if a HP-UX system is virtual or not

Hi,

Is there a command or a way in which I can find out if a particular HP-UX machine is Virtual or not?

I think vparstatus -w -M will show me the vpars but this command also requires Superuser.

Is there a command which a normal user can run which will give me this information.

Thanks,

Vineet
9 REPLIES 9
Richard Hepworth
Esteemed Contributor

Re: Checking if a HP-UX system is virtual or not

Vineet,

The following can show you if vPars is installed and whether a vpar database exists but it is not 100% proff that the server is running as a vpar:

/usr/sbin/swlist | grep "Virtual Partitions"
ll /stand/vpdb (check modified time)

Not sure if you can get 100% certainty from non-root user....

regards,

Richard
Jozef_Novak
Respected Contributor

Re: Checking if a HP-UX system is virtual or not

Hello,

if you were referring to HP Integrity Virtual Machines, then "model" command would give you the answer:

#model
ia64 hp server Integrity Virtual Machine

As for vpars, it is not that straightforward, especially if you don't have root access.

J.
Johnson Punniyalingam
Honored Contributor

Re: Checking if a HP-UX system is virtual or not

Hi Vineet,

>>>I think vparstatus -w -M will show me the vpars but this command also requires Superuser.<<<

Yes , You are right normal "user cannot"

>>Is there a command which a normal user can run which will give me this information.<<

No.

Thanks,
Johnson
Problems are common to all, but attitude makes the difference
Vineet Deshpande
Frequent Advisor

Re: Checking if a HP-UX system is virtual or not

Hi All,

Thanks a lot for your prompts answers.

I would like to confirm just 1 thing. Are there just the 2 ways in which Virtualization can be implemented in HP viz. vPars and Integrity Servers??

Thanks,

Vineet
Pete Randall
Outstanding Contributor

Re: Checking if a HP-UX system is virtual or not

Yes, just the two ways - unless you count physical partition: npars.


Pete

Pete
likid0
Honored Contributor
Solution

Re: Checking if a HP-UX system is virtual or not

A normal user can run vecheck:

vecheck(1):
DESCRIPTION
The vecheck command uses its exit status to report whether or not the
command has been run in a virtual partition (vPars) environment. The
result can be used to alter command flow in a script.
...
RETURN VALUE
The vecheck command exits with one of the following values:

0 The command is run in a vPars environment.
255 The command is run in a non-vPars environment.
Windows?, no thanks
Avinash20
Honored Contributor
Avinash20
Honored Contributor

Re: Checking if a HP-UX system is virtual or not

"I have assigned points to 21 of 91 responses to my questions."

Please assign points to your thread. Just a way of saying Thanks for the right answers
"Light travels faster than sound. That's why some people appear bright until you hear them speak."

Re: Checking if a HP-UX system is virtual or not

I'm thinking that any OS image that is running in a vPar is going to have the vpard daemon running, so its not an official command, but a reasonable way of checking this would be:

UNIX95= ps -Cvpard >/dev/null 2>&1 && echo "This is a vPar"

Any user can look at the process table so that should work for non-root users.

Of course even within the bounds of a single OS you can't assume you have access to all the CPUs and memory as there is also Processor Sets and the Fair Share Scheduler to consider. Might be worth having a look at this technical paper:

http://docs.hp.com/en/9450/vse_tips_for_application_developers.pdf

HTH

Duncan


I am an HPE Employee
Accept or Kudo