• Skip to site navigation
  • Skip to blog entries
  • Skip to archive page
  • Skip to right sidebar

Onder de motorkap van VI-3

Eric Sloof - NTPRO.NL

  • NTPRO.NL
  • Online Training
  • VMworld
  • Videos
  • Tools
  • iTunes
  • About

Friday, 16 March 2007

Onder de motorkap van VI-3

Putty

Wanneer je aanlogd op het service console bestaan er een aantal ongedocumenteerde commando’s waar hele nuttige dingen mee gedaan kunnen worden.

Zo ontdekten Viktor van den Berg en Christiaan Roeleveld dat het mogelijk is om met het onderstaande script een ESX host in maintenace mode te zetten. Dit kan handig zijn wanneer je een script laat draaien wat alle updates installeert.

vimsh -n -e /hostsvc/maintenance_mode_enter 
vimsh -n -e /hostsvc/maintenance_mode_exit 

Verder heb ik zelf  nog een aardige optie gevonden, een commando waarmee je via het service console kunt achterhalen wat voor type kaart in welk PCI slot zit.

vimsh
[/]$ ?
hostsvc/      ?             
csls                pinfo         puse
internalsvc/  argtype       csuimport     pload         quit
solo/         cls           echo          ploadpath     sleep
vimsvc/       csimport      exit          pls           source
vmsvc/        csinfo        help          puload
[/]$ hostsvc/host
hostconfig    hosthardware  hostsummary
[/]$ hostsvc/hosthardware


Er wordt dan een lijst gegenereerd met bijvoorbeeld het onderstaande blok voor een netwerkkaart.
Code:

      (vim.host.PciDevice) {
         dynamicType = <unset>,
         dynamicProperty = (vmodl.DynamicProperty) [],
         id = "03:01.0",
         classId = 512,
         bus = 3,
         slot = 1,
         function = 0,
         vendorId = 5348,
         subVendorId = 3601,
         vendorName = "Broadcom Corporation",
         deviceId = 5704,
         subDeviceId = 208,
         deviceName = "NC7782 Gigabit Server Adapter (PCI-X, 10,100,1000-T)"

De vimsh wrapper maakt uiteindelijk gebruik van de vsh binary, deze kun je ook vanaf het SC interactief starten.
Code:

#!/bin/sh
#
# Wrapper for the real binary. Ensure that the binary will find all
# the shared libraries it needs. If a shared library is not available from any
# of the standard system-wide locations, we provide it from the build
# directory. --hpreg
#

# Use readlink only when necessary: some boxes don't have it, some boxes have
# one that does not support the -f option. --hpreg
if [ -h "$0" ]; then
   this="`readlink -f "$0"`"
else
   this="$0"
fi

libdir=/usr/lib/vmware/hostd
binary=/usr/bin/vsh

abslibdir="`cd \"$libdir\" 2>/dev/null && pwd || echo \"$libdir\"`"
cd $libdir

# Check for request to connect remotely.
extracommands="-e \"vmsvc/connect\" -e \"vmsvc/login\" "
if [ -n "$1" ]; then
   if [ "$1" == "-r" ]; then
       shift
       extracommands=''
   fi
fi

LD_ASSUME_KERNEL=$LD_ASSUME_KERNEL LD_LIBRARY_PATH="$abslibdir" \
   $DEBUG_CMD $binary \
   -e 'csuimport vmdb /' \
   -e 'puse '"$libdir"'/libhostsvc.so' \
   -e 'puse '"$libdir"'/libsolo.so' \
   -e 'puse '"$libdir"'/libvmsvc.so' \
   -e 'puse '"$libdir"'/libvimsvc.so' \
   -e 'puse '"$libdir"'/libinternalsvc.so' \
   $extracommands \
  "$@"


Dan zie je het volgende lijstje:
Code:

[root@foxtrot root]# vsh
[/]$ help
?           connect     equals      pinfo       rget        uwatch
abort       csimport    exit        pload       rls         wait
argtype     csinfo      get         ploadpath   set         watch
begin       csls        help        pls         sleep
bget        csuimport   listen      puload      source
cat         disconnect  localunset  puse        ulisten
cd          echo        ls          pwd         umount
cls         end         mount       quit        unset
[/]$

Posted by
Eric Sloof
in Dutch at 10:17
Bookmark and Share
Trackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as (Linear | Threaded)
No comments
The author does not allow comments to this entry


Twitter RSS FeedLinkedIn

www.hetesambal.nl

Veeam Webinar with Doug Hazelman: 5 Steps to Successful Backup & Replication for Hyper-V! Watch it now >>

Recent Entries

White Paper - Mobility and Disaster Recovery Solution for Virtualized Tier-1 Enterprise Applications
Saturday, January 21 2012
Video - Install vSphere Syslog Collector and configure ESXi logging
Friday, January 20 2012
Storage Design and Implementation in vSphere 5.0 - The Rough Cuts
Thursday, January 19 2012
Top 25 Free Tools for VMware vSphere presented by David Davis and Kendrick Coleman
Monday, January 16 2012
LG Android running VMware Horizon Mobile hands-on
Saturday, January 14 2012
Forbes Guthrie has released the vSphere 5 vReference Card
Thursday, January 12 2012
VMworld Session - VMware vMotion in VMware vSphere 5: Architecture, Performance & Best Practices
Wednesday, January 11 2012
Voice Over IP (VoIP) Performance Evaluation on VMware vSphere 5.0
Tuesday, January 10 2012
VMware vCloud Director 1.5 Performance and Best Practices
Monday, January 9 2012
VMware vCenter Site Recovery Manager 5.0 Performance and Best Practices
Sunday, January 8 2012

Archive

  • February 2012 (6)
  • January 2012 (22)
  • December 2011 (21)
  • November 2011 (24)
  • October 2011 (27)
  • September 2011 (26)
  • August 2011 (35)
  • July 2011 (26)
  • June 2011 (15)
  • May 2011 (20)
  • April 2011 (22)
  • March 2011 (22)
  • February 2011 (18)
  • January 2011 (13)
  • December 2010 (23)
  • November 2010 (18)
  • October 2010 (31)
  • September 2010 (22)
  • August 2010 (23)
  • July 2010 (19)
  • June 2010 (19)
  • May 2010 (19)
  • April 2010 (20)
  • March 2010 (23)
  • February 2010 (22)
  • January 2010 (30)
  • December 2009 (37)
  • November 2009 (29)
  • October 2009 (27)
  • September 2009 (36)
  • August 2009 (35)
  • July 2009 (35)
  • June 2009 (43)
  • May 2009 (35)
  • April 2009 (56)
  • March 2009 (51)
  • February 2009 (69)
  • January 2009 (69)
  • December 2008 (60)
  • November 2008 (56)
  • October 2008 (49)
  • September 2008 (63)
  • August 2008 (44)
  • July 2008 (54)
  • June 2008 (26)
  • May 2008 (34)
  • April 2008 (27)
  • March 2008 (38)
  • February 2008 (29)
  • January 2008 (35)
  • December 2007 (24)
  • November 2007 (23)
  • October 2007 (20)
  • September 2007 (54)
  • August 2007 (15)
  • July 2007 (22)
  • June 2007 (13)
  • May 2007 (8)
  • April 2007 (20)
  • March 2007 (10)
  • Recent...
  • Older...
Based on the s9y Bulletproof template framework
Powered by s9y – Template by Bulletproof development team.
  • NTPRO.NL
  • Online Training
  • VMworld
  • Videos
  • Tools
  • iTunes
  • About