• 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

VCB and independent disks

Duncan Epping · Nov 3, 2008 ·

Most of you probably knew that it is impossible to snapshot an independent/persistent disk. And if you didn’t, in short: a disk that is in “independent/persistent” mode can’t be snapshot because it needs to write it’s changes immediately to the virtual harddisk. When using a snapshot(nonpersistent) writes go to a delta file.

So as I said in this article, using this mode on a specific disk is a nice way to get the full image VM without for instance that gigantic data disk. But some of you might need the snapshot functionality, and it’s not possible to change the disk state from the VirtualCenter client when the VM is up and running.

But it is possible to change the state via the command-line when the VM is running. So if you want to change the state in a VCB script for a specific disk, or want to change the state for a VM without shutting it down here you go:

Find out what the current mode is from the command line:

vmware-cmd <path to vmx file.vmx> getconfig scsi0:0.mode

Set the new mode from the command line:

vmware-cmd <path to vmx file.vmx> setconfig scsi0:0.mode “persistent”

Keep in mind that this is, as far as I know, not supported and should be tested thoroughly before using. I would prefer doing it manually and keeping it that way. Or you could always use the script that I blogged about a while back, it makes it possible to dump specific disks without having to resort to unsupported methods.

By the way, with the setconfig option you can set most vmx options!

 

Which VM is connected to an RDM?

Duncan Epping · Nov 3, 2008 ·

A friend of mine asked me if there was a way to find out which VM’s were connected to a certain RDM disk. I’ve been looking all over but couldn’t find a simple command to do this. So I ended up on the forums and found a powershell script which creates a list with all the necessary info one would like to have:

$report = @()
$vms = Get-VM | Get-View
foreach($vm in $vms){
foreach($dev in $vm.Config.Hardware.Device){
if(($dev.gettype()).Name -eq “VirtualDisk”){
if(($dev.Backing.CompatibilityMode -eq “physicalMode”) -or
($dev.Backing.CompatibilityMode -eq “virtualMode”)){
$row = “” | select VMName, HDDeviceName, HDFileName, HDMode
$row.VMName = $vm.Name
$row.HDDeviceName = $dev.Backing.DeviceName
$row.HDFileName = $dev.Backing.FileName
$row.HDMode = $dev.Backing.CompatibilityMode
$report += $row
}
}
}
}
$report

All credits for this great script go to LucD!

Update: Quick Migration

Duncan Epping · Oct 3, 2008 ·

A couple of days ago I wrote about the Quick Migration script that Mike D wrote with Powershell. Like I said, it should be possible to integrate the script with VC. Well this has been done by Dennis of Icomasoft. Icomasoft recently released the Powershell Plugin for VirtualCenter. And with this plugin you can easily integrate your scripts into VirtualCenter which makes it even more easy to run your scripts. You can find the altered script here, it includes a nice progress bar…

Thanks Thomas, for pointing me out! And great work by Dennis!

Scripted installs

Duncan Epping · Oct 3, 2008 ·

Everyone installing more than 2 or 3 ESX hosts at a time should start with scripting their installation in my opinion, why?:

  1. it will save time
  2. consistent installations
  3. no need anymore for doing backups of the ESX host
These three should be enough reasons to start scripting. A good place to start is this topic on the VMTN Forums and my Blog post.
One of the dangers most of you will face is the fact that the SAN is attached during installation. So what’s the danger? Well if you’re unlucky the installation will be done on a SAN LUN. This is very hard to prevent in the installation scripts. Because of that Bouke of Jume created a script which removes the HBA drivers from the setup. So if you’re doing scripted installs, and don’t want to unplug your fiber when you do an installation be sure to use this excellent script on your installation media!
Let’s hope Bouke can find some more time and keeps on blogging!

VMware Quick Migration

Duncan Epping · Oct 1, 2008 ·

How cool is this Powershell script! Mike D. wrote a powershell script that does exactly what Hyper-V’s quick migration does. It should be possible to integrate it with the VC Client, and if they open up the ESXi SDK as Mike suggest than you have the functionality for the free hypervisor from VMware. By the way talking about a free hypervisor, Hyper-V is also available as of today.

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 12
  • Page 13
  • Page 14
  • Page 15
  • Page 16
  • 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