VMware Cloud Community
sdionsw
Contributor
Contributor
Jump to solution

Changing disk persistence

Following this thread, trying to change disk persistence on a running VM using powercli (latest version... 5.8 I believe).

Changing persistent <-> non-persistent disks

Doing so results in an error "Device 'scsi0:1' already exists" (same error in both powercli and in the vSphere client).

Does this functionality still work? Anything I am missing?

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

I'm afraid not


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

View solution in original post

0 Kudos
7 Replies
LucD
Leadership
Leadership
Jump to solution

I'm afraid not


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

0 Kudos
sdionsw
Contributor
Contributor
Jump to solution

That stinks! OK, well at least I know now!

0 Kudos
BenConrad
Expert
Expert
Jump to solution

This seems to be a bug, i'm not sure where the bug is (PowerCli or vSphere) but we used to do this frequently while VMs were online.  It's especially useful when somebody adds a new disk to a sql server and then we find that the disk needs to be changed to IndependentPersistent so it's not affected by snapshots.

PS E:\> $disk = $vm | Get-HardDisk | ? {$_.name -eq 'Hard disk 2'}

PS E:\> $disk | Set-HardDisk -Persistence IndependentPersistent -Confirm:$false

Set-HardDisk : 6/16/2015 3:52:25 PM    Set-HardDisk       Device 'scsi0:1' already exists.    At line:1 char:9

+ $disk | Set-HardDisk -Persistence IndependentPersistent -Confirm:$false

+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [Set-HardDisk], GenericVmConfigFault

    + FullyQualifiedErrorId : Client20_VirtualDeviceServiceImpl_UpdateAttachedVirtualHardDisk_ViError,VMware.VimAutoma

   tion.ViCore.Cmdlets.Commands.VirtualDevice.SetHardDisk

Do you happen to know if this is a bug in PowerCli or vSphere (5.5 in our case)?

Ben

0 Kudos
aamodei01
Enthusiast
Enthusiast
Jump to solution

Is this the way VMware is moving? Or is it just a bug in this version?

To say, is this going to be "fixed" in the future?

Is there another way to do this without VM powerdown? I can understand the other features that set-harddisk can do needing to be powered down, but disk persistance?

0 Kudos
thomsonac
Contributor
Contributor
Jump to solution

Sorry to revive an old post but at this year's VMworld I attended a (great) group session with Alan, LucD, and William Lam regarding PowerCLI.  Towards the end I asked a question regarding this exact procedure of changing the persistence level of a running VM and William indicated that it was possible via get-view.  I don't have any experience with get-view and have spent a couple of hours trying to figure out how I might change settings without any luck.

Could one of the grand-wizards take another look? Smiley Happy LucDlamw

Thanks all!

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Just tested this again on vSphere 5.5 and 6, and my method that worked in 4.x, isn't working anymore.

The error "Device 'scsix:y' already exists" is returned.

Perhaps William knows about another method that would allow to do this in 5.5 and/or 6, but I don't I'm afraid.


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

0 Kudos
thomsonac
Contributor
Contributor
Jump to solution

Thanks for giving it a shot.  Still holding out hope that William knows the trick

0 Kudos