• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • Unexplored Territory Podcast
  • HA Deepdive
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

Scripting

Enable VMotion from the command-line

Duncan Epping · Dec 8, 2008 ·

Just had a chat with someone on-line about a scripted install, as of ESX 3.5 the way to enable VMotion via the command-line changed. So for anyone looking for this particular command:

/usr/bin/vmware-vim-cmd "hostsvc/vmotion/vnic_set vmk0"

In this example “vmk0” is the first vmkernel. This is one of the things that changed, so no portgroup id’s anymore. And if you need to do anything via the command-line that doesn’t seem to be possible with the normal commands: vmware-vim-cmd. Definitely the way to go.

Installing VMware tools without a reboot?

Duncan Epping · Nov 27, 2008 ·

I’ve been getting a lot of questions on this script that makes it possible to install VMware tools without rebooting. I must admit that it’s a really smart way to surpress the automatic reboot. But please keep in mind that it’s not VMware Tools that needs the reboot but the actual OS that needs the reboot. Why? VMware tools includes device drivers! The “tools” itself is a service that can easily be restarted but that’s clearly not something you would do with a device driver. And don’t forget about what happens to your nic driver when it’s being updated… yes, all network connection will drop.

So I do think this script can be usefull if you want to do a manual reboot at a certain time. But please be sure reboot the VM as soon as possible, cause not rebooting the VM can and probably will cause problems.

Adding a role to a user from the Service Console

Duncan Epping · Nov 24, 2008 ·

Three weeks ago I blogged about a powershell script that can assign roles to users. This is very handy when doing scripted installs cause it seemed that it was impossible to add a role to a user from the Service Console. Today we had a discussion via email and my colleague from South Africa, Hugo, actually found out how to add a role to a certain user from the Service Console:

vmware-vim-cmd vimsvc/auth/entity_permission_add vim.Folder:ha-folder-root 'newuser' false ReadOnly true

The command used is “vmware-vim-cmd” aka “vimsh”. “vim.Folder:ha-folder-root” is on cluster level, ‘newuser’ is the username of the user you want to add the role to and the role is “ReadOnly”. False and true are values for “isgroup” and “propagate”.

Great job Hugo, and thanks for letting me know about this solution.

HAL check?!

Duncan Epping · Nov 14, 2008 ·

My post about reverting your HAL triggered Alanrenouf to create a short, but very cool script that compares the amount of cpu’s to the windows HAL you’ve chosen. This way you will know within a second if you need to change the HAL of any of your vm’s! Cool stuff:

connect-viserver MYVISERVER
$myCol = @()
ForEach ($VM in (Get-VM))
{
$MyDetails = “” | select-Object Name, HAL, NumvCPU
$MYDetails.Name = $VM.Name
$Hal = Get-WmiObject -ComputerName $VM.Name -Query “SELECT * FROM Win32_PnPEntity where ClassGuid = ‘{4D36E966-E325-11CE-BFC1-08002BE10318}'” | Select Name
$MYDetails.HAL = $Hal.Name
$MYDetails.NumvCPU = $VM.NumCPU
$myCol += $MYDetails
}
$myCol

revert your HAL!

Duncan Epping · Nov 14, 2008 ·

A couple of weeks ago I did a design review. During this review we discussed the process of reverting your “HAL”, on a Microsoft machine, from multi cpu to single cpu. The customer just emailed me a script that can automate this for you. After some googling I noticed that Mike Laverick already wrote an article on this well over two years ago, which also contains this script. (more or less the same) Still I would like to share this with you guys:

@echo off

:DRIVER_HAL_UPDATE
SET HAL=

IF %NUMBER_OF_PROCESSORS%==1 (
devcon.exe /find @ROOT\ACPI_HAL\0000 | find /i “Multiprocessor” > NUL && SET HAL=ACPIAPIC_UP
devcon.exe /find @ROOT\PCI_HAL\0000 | find /i “Multiprocessor” > NUL && SET HAL=MPS_UP
) ELSE (
devcon.exe /find @ROOT\ACPI_HAL\0000 | find /i “Uniprocessor” > NUL && SET HAL=ACPIAPIC_MP
devcon.exe /find @ROOT\PCI_HAL\0000 | find /i “Uniprocessor” > NUL && SET HAL=MPS_MP
)

IF NOT “%HAL%”==”” (
ECHO.
ECHO —————————————-
ECHO Installing %HAL% HAL
ECHO —————————————-
ECHO.

devcon.exe sethwid @ROOT\PCI_HAL\0000 := !E_ISA_UP !ACPIPIC_UP !ACPIAPIC_UP !ACPIAPIC_MP !MPS_UP !MPS_MP !SGI_MPS_MP !SYSPRO_MP !SGI_MPS_MP
devcon.exe sethwid @ROOT\ACPI_HAL\0000 := !E_ISA_UP !ACPIPIC_UP !ACPIAPIC_UP !ACPIAPIC_MP !MPS_UP !MPS_MP !SGI_MPS_MP !SYSPRO_MP !SGI_MPS_MP
devcon.exe sethwid @ROOT\PCI_HAL\0000 := +%HAL%
devcon.exe sethwid @ROOT\ACPI_HAL\0000 := +%HAL%
devcon.exe update %windir%\inf\hal.inf %HAL%
devcon.exe ReScan

ECHO.
ECHO —————————————-
ECHO Rebooting
ECHO —————————————-
ECHO.
devcon.exe Reboot
) ELSE (
ECHO.
ECHO —————————————-
ECHO Correct HAL Detected
ECHO —————————————-
ECHO.
)
GOTO :EOF

There’s a topic on VMTN about this, read it. You need the Microsoft DevCon util, which is part of the support tools, for more info on devcon click here. Mike Laverick’s paper can be found here. Thanks for pointing this out Xing.

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 10
  • Page 11
  • Page 12
  • Page 13
  • Page 14
  • Interim pages omitted …
  • Page 18
  • Go to Next Page »

Primary Sidebar

About the Author

Duncan Epping is a Chief Technologist and Distinguished Engineering Architect at Broadcom. Besides writing on Yellow-Bricks, Duncan is the co-author of the vSAN Deep Dive and the vSphere Clustering Deep Dive book series. Duncan is also the host of the Unexplored Territory Podcast.

Follow Us

  • X
  • Spotify
  • RSS Feed
  • LinkedIn

Recommended Book(s)

Advertisements




Copyright Yellow-Bricks.com © 2025 ยท Log in