mfugazzi
Contributor
Contributor

New-harddisk not creating /dev/sdb

Jump to solution
Hi. Trying to add a new disk on CentOS 7.6 using PowerCLI 12.6.0-19610541 and PowerShell 7.2.2-1 on ESXi  6.7 and 7.0.3 Build 19482537, but it doesn't create /dev/sdb in the guest.
 
PS root> Get-VM myvm | New-HardDisk -CapacityGB 10 -Persistence persistent
 
CapacityGB Persistence Filename
---------- ----------- --------
10.000 Persistent [LUN0] myvm/myvm_2.vmdk
 
PS root> Get-VM myvm | get-harddisk
 
CapacityGB Persistence Filename
---------- ----------- --------
12.000 Persistent [LUN0] myvm/myvm-000001.vmdk
10.000 Persistent [LUN0] myvm/myvm_2.vmdk
 
PS root> ls /dev/sd*
/dev/sda /dev/sda1 /dev/sda2
 
This worked on ESXi 7.0.2 previously. Is this a known issue? Thanks
1 Solution

Accepted Solutions
LucD
Leadership
Leadership

You could use Code Capture and add a harddisk with the Web Client, that should show you which API methods and parameters the client uses.
Another option is to look in the vpxd log, with verbose logging turned on, and check if there differences between the methods called from the New-Harddisk cmdlet and from the Web Client.

You could also have a look in the vmware.log of the target VM if there are any calls made via VMware Tools to the guest OS.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

6 Replies
LucD
Leadership
Leadership

Does the new disk show up in the Hardware Browser?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
mfugazzi
Contributor
Contributor

I'm sorry - I don't know what the hardware browser is. How do I check that?

I manually added a disk in the web client, and that worked as expected.

0 Kudos
LucD
Leadership
Leadership

The Hardware Browser is a package (hwbrowser) for CentOS accessible via System/Administrator/Hardware Brwoser.

Not sure how the Web client does this, but when adding a new disk, with New-Harddisk, to a VM that runs CentOS 7.*, I normally have to do

partprobe
pvcreate /dev/sdb(x)
pvdisplay




Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
mfugazzi
Contributor
Contributor

Thanks. hwbrowser requires kudzu which is no longer available since CentOS 5, so I can't install it. I can see the new disk with Get-HardDisk and when I look at the VM's directory on its host's datastore. When I look in the web client for the VM configuration, it's not there. 

Regarding partprobe - exactly. partprobe finds the new disk device /dev/sdx, but in my case New-HardDisk isn't creating /dev/sdx and appears not to touch the OS. So though Get-HardDisk can see the additional disk, the OS can't. 

Is there additional logging or a verbose setting we can use with New-HardDisk? 

0 Kudos
LucD
Leadership
Leadership

You could use Code Capture and add a harddisk with the Web Client, that should show you which API methods and parameters the client uses.
Another option is to look in the vpxd log, with verbose logging turned on, and check if there differences between the methods called from the New-Harddisk cmdlet and from the Web Client.

You could also have a look in the vmware.log of the target VM if there are any calls made via VMware Tools to the guest OS.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

mfugazzi
Contributor
Contributor

Pilot error. I was using the wrong VM name. Thanks for your speedy responses! 

0 Kudos