BUG? : Hard drive remove / Remove-VM [DO NOT DELETE]

Hi guys,.

I have 2 questions on a single code segment:

$oldVM = Get-VM -Name $targetVMname

Get - hard drive -VM $oldVM | Remove HDD of the -DeletePermanently -confirm:$false

Remove-VM -VM $oldVM -DeletePermanently:$true -confirm:$false

The problem is that just the VMDK is left later in the datastore VM folder. That is why "-DeletePermanently" is not entirely effective.

Someone had this problem?  I know that the solution is to go in the way of creating a function where you specify the data store, the record and the name of the file to remove the orphan OS VMDK - but the above code should work!

I even had the code to erase the disc trying first before deleting the entire virtual machine.

But the operation said 'delete '.

$vmclonespec.config.deviceChange [0] .operation = 'delete '.


Tags: VMware

Similar Questions

  • How can I retrieve my files from the clouds after my hard drive has crashed - files were not deleted.

    How can I retrieve my files from the clouds after my hard drive has crashed - files were not deleted.

    Don't know what your problem is - log on to Skydrive and recover the files that you need them, or download the app to Skydrive and they will all be uploaded at the same time.

  • Why do not the remove-hard drive remove a disc with a new SCSI controller?

    Hi PowerCLI gurus,

    I try to use PowerCLI to automate the solution for article configuration of disks to use VMware Paravirtual (PVSCSI) SCSI adapters (1010398).

    Remove-hard drive sometimes gives me a misleading error when I use it to remove a hard drive with a new SCSI controller.

    The FlatHardDisk specified 'Hard disk 3' no longer exists, or never existed.

    Can anyone here explain the error?

    My version of vCenter server is 5.1.0.

    My PowerCLI version is 2.0.

    Here's what I've done to reproduce the error.

    First of all, I connect to vCenter and stop the virtual machine.

    $TestVM = 'TESTVM '.

    $TestServer = ' vcenter - test.local ".

    SE connect-VIServer-Server $TestServer

    Stop-VM - $TestVM VM - confirm: $false

    I add a new hard drive and store it in a variable so I can refer to it for the next steps.

    New hard drive '.

    -VM $TestVM '

    -Persistent persistence"

    -Flat DiskType '

    CapacityKB - 1024'

    StorageFormat - thin '

    -OutVariable TempDisk

    I make a note of its name.

    $TempDisk.Name

    Because my VM already has 2 discs, the output is "hard drive 3.

    Then I add a new SCSI controller on the hard drive.

    New SCSI controller.

    Hard drive - $TempDisk '

    -Type ParaVirtual '

    NoSharing - BusSharingMode

    Now, I try to remove the hard drive from the variable to remove the disc.

    Remove-hard drive - hard drive $TempDisk - DeletePermanently-confirm: $false

    It fails with an error that says "Hard drive 3" has already been removed.

    Remove HDD: 12/02/2014-18:51:33 remove-hard drive the FlatHardDisk specified 'Hard disk 3' no longer exists, or never existed.

    On line: 1 char: 1

    + Delete-hard drive - hard drive $TempDisk - DeletePermanently-confirm: $false

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

    + CategoryInfo: ObjectNotFound: (3:FlatHardDiskImpl drive) [Remove-hard drive], VimException

    + FullyQualifiedErrorId: Client20_VirtualDeviceServiceImpl_TryValidateDeviceExists_DeviceDoesNotExist, VMware.VimAutomation.ViCore.Cmdlets.Commands.RemoveHardDisk

    But I see that there are still "hard drive 3"!

    Get-disk hard - VM $TestVM - name 'hard drive 3.

    CapacityGB persistence Filename

    ----------      -----------                                    --------

    0.001 persist... B-DATA-01] TESTVM/TESTVM_9.vmdk

    Is this a bug or am I missing something?

    I don't think that the cmdlet uses actually the UID, but more likely a MoRef to the vSphere object that represents the hard disk.

    Remember that under the covers most of the PowerCLI cmdlets do calls to the vSphere API.

    Change the Uid, property value indicates that the hard drive connected to the new controller is a new and different purpose.

    And this explains why the hard drive remove does not work with the original hard disk object, it no longer exists.

  • I have always used the windows logo + L key to lock my computer, I remove things from my hard drive and now it locks not for me... need your help :)

    I have always used the windows logo + L key to lock my computer, I remove things from my hard drive and now it locks not for me... need your help :)

    Hi ddbowers01,

    The other shortcut keys work?

    Try pressing CTRL + ALT + DELETE and then try to lock the computer and check.

    Check the setting below:

    a. in the Control Panel, click user accounts.

    b. click on change the way users log on or off the power.

    c. Click to uncheck use the screen of welcome for a quick and easy connection.

    d. click OK.

    With regard to:

    Samhrutha G S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • I currently store my pictures on and an external hard drive.  Lightroom 6 was not able to find the picture momentarily files.  I inserted an external Flash DRIVE after removing the hard drive and the computer renamed the stick with the same drive letter t

    Redesign existing external hard disks and still 6 Lightroom able to find existing photos.

    I currently store my pictures on and an external hard drive.  Lightroom 6 was not able to find the picture momentarily files.  I inserted an external Flash DRIVE after removing the hard drive and the computer renamed the stick with the same drive letter that has been designated by Lightroom to store my photos.  I could go into my Windows 10 and reset the player to the letter that Lightroom has given at the beginning of the external hard drive.   However, I know this can happen again, if I connect any stick USD or another device, while the external hard drive is not connected to my laptop.   I found the information that I can do the new designation of the final drive by choosing a letter it is 1/2 way or higher in the alphabet.   I would like to turn an external hard drive on a strong letter, warns we hope this previous problem.   My question is, if I already have a lot of pictures on this external hardrive with the designation of the current drive, how it becomes a higher letter and have 6 Lightroom recognizes files, now under the new designation of drive letter without having to go to each photo individually and manually force Lightroom 6 find each photo.  It would take more time than I'd like to lose.  Is there a way to get just 6 Lightroom to recognize the new disk designation has changed and is able to find all of the existing files?

    I have read the ADOBE LightRoom 6 manual and seem not to be able to find anything on how to do it.

    Any help would be welcome.

    Thank you!

    So in Windows, you can select a drive like q letter (or any other letter you want only towards the end of the alphabet)

    Then in Lightroom, you can reconnect to the photos on q: the following instructions (see specifically 4 Figure and related text)

    Adobe Lightroom - find moved or missing folders and files

  • Memory full. HPW to identify and remove duplicate files. great western digital external hard drive is that it is not working properly

    hsving obvous problem assostated with little or no space drive. slow operion of progtams "program does not" and 'unable to write' trusted sites.

    Sometimes when the hard disk becomes incredibly full, you can even copy files to an external hard drive. In such cases, simply pull the disk and put in a USB external hard drive case. Attach it to a working computer and copy the data in this way, either on a drive in the system of work or another external hard drive (it will be slower). Delete the data out of the full disc. MS - MVP - Elephant Boy computers - don't panic!

  • Hard drive remove unexpected behavior of vSphere 4.1

    Hello

    I'm having some trouble with to remove a hard drive from a virtual computer by using the cmdlet Remove-hard drive in PowerCLI. I can list the disks attached to the virtual machine and I'm trying to delete is in the list, but when I run the command remove the disc it returns an error indicating that the VMDK file is not attached to a virtual machine. I am able to remove the disc using the user interface of vCenter.

    Please see below for the relevant order details and error output.

    Thank you.

    Brian

    PS C:\Users\administrator. W2K8 > get-disk hard - vm "w2k8-sql1.

    CapacityKB persistence Filename
    ---------- -----------                                                    --------
    52428800 persistent [nfsstore1] w2k8-sql1/w2k8-sql1 - 000002.vmdk
    8388608 persistent [sql2_db_mt] w2k8-sql1/w2k8 - sql1.vmdk
    3148740 IndependentPersis... 8 sql1/w2k8 - sql1_SD_netapp1_hoida4fUQZfc_0.vmdk
    3148740 IndependentPersis... 8 sql1/w2k8 - sql1_SD_netapp1_hoida4fUQgQ1_1.vmdk
    8388608 persistent [sql2_log_mt] w2k8-sql1/w2k8 - sql1.vmdk
    7325640 IndependentPersis... 8 sql1/w2k8 - sql1_SD_netapp1_hoida4fVHLK5_2.vmdk
    7325640 IndependentPersis... 8 sql1/w2k8 - sql1_SD_netapp1_hoida4fVHRVR_3.vmdk
    9437184 permanent... .kup w2k8-sql2_backup)] w2k8-sql2/w2k8 - sql2.vmdk
    9437184 permanent... .kup w2k8-sql2_backup)] w2k8-sql2/w2k8 - sql2.vmdk


    PS C:\Users\administrator. W2K8 > get-hard drive - data store '(backup w2k8-sql2_backup) sql2_db' - datastorepath '[sql2_db (Ba '.
    "BACKUP w2k8-sql2_backup)] w2k8-sql2/w2k8 - sql2.vmdk | Hard drive remove

    Confirm
    Are you sure you want to perform this action?
    Operation "Remove disc" target "w2k8 - sql2.vmdk.
    [Y] yes [A] Yes to all [N] no [L] no to all [S] Suspend [?] Help (default is "Y"): y
    Remove-hard drive: 2011-10-14 13:32:29 Remove-disk hard FlatHardDisk The ' w2k8 - sql2.vmdk' is not attached to
    a virtual machine. The requested operation is only supported for devices connected to the virtual computer.
    At line: 1 char: 156
    + get-hard drive - data store '(backup w2k8-sql2_backup) sql2_db' - datastorepath ' [sql2_db (backup w2k8-sql2_backup)] w2k8-
    "SQL2/w2k8 - sql2.vmdk | Hard drive remove < < < <
    + CategoryInfo: InvalidArgument: (w2k8 - sql2.vmdk:FlatHardDiskImpl) [Remove-hard drive], VimException
    + FullyQualifiedErrorId: Client20_VirtualDeviceServiceImpl_TryValidateDeviceOwnerIsVm_IsDatastore, VMware.VimAutom
    ation.ViCore.Cmdlets.Commands.RemoveHardDisk

    Hello, bmoncsko-

    Welcome to the communities.  As for your question, it seems that it would be a 'feature' (or bug) in how hard drive Remove works.  I tested what you did and got the same results using PowerCLI 4.1u1 and 5.0.

    However, it works when you select the hard drive to the virtual computer by name through the pipeline (instead of the path of the data store), as:

    ## get the VM's harddisks, displaying their names as wellGet-HardDisk -VM myVM | ft Name,CapacityKB,Filename
    
    ## determine from above the name of the harddisk to be removed, and use that to choose that harddisk, then remove itGet-VM myVM | Get-HardDisk | ?{$_.Name -eq "Hard disk 4"} | Remove-HardDisk -DeletePermanently -Confirm:$false
    

    It would be interesting to know if other people receive the same behavior when trying to remove the hard drive as you did, but this piece of code, you should get going at the moment.

  • Bought the new computer windows 10, itunes has changed location of support for external hard drive. The music does not appear in itunes.

    BOUGHT NEW COMPUTER WINDOWS 10, CHANGED ITUNES MEDIA LOCATION FOR EXTERNAL HARD DRIVE. THE MUSIC DOES NOT APPEAR ON ITUNES.

    Changing the iTunes media folder location setting affects only where new additions to your library will be stored.  To use a disk external drive to store your library complete (and assuming that you have access to the original data of the library on an old computer) you must copy the iTunes folder, by default in C:\Users\username\Music, on the external drive - structure library and its records should be like this:

    The hold button SHIFT DOWN when you start iTunes and when you see this message:

    Click choose a library... then find and select the iTunes Library.itl in iTunes on your external drive folder.

    For more information, see user turingtest2 on make a library of portable split.  You must also acquire a 2nd external drive and allows create and maintain a backup your library.

  • My MacBook Pro runs very slowly.  I El Captain 10.11.4 rare apps on it, most are closed while I'm on safari.  My photos take a 125 gb storage capacity.  If that is the question, what external hard drive is recommended?  If not, what is?

    My MacBook Pro runs very slowly.  I El Captain 10.11.4 rare apps on it, most are closed while I'm on safari.  My photos take a 125 gb storage capacity.  If that is the question, what external hard drive is recommended?  If not, what is?

    Download and and publish a report of Etrecheck:

    http://etrecheck.com/

    Ciao.

  • hard drive went and HP said not included in the warranty?

    I'm stumped.

    My computer would not start.

    HP now tells me that it is not included in the warranty, since it must have had spilled water on it, or dropped.

    This is not true.

    He has simply stopped working on me.

    How can they be sure that it was not a mechanical problem?

    They told me to call customer service, but the number they gave me 866-442-7029 is not correct.

    What should I do now?

    Well,.

    Finally, we have the bottom of things.

    After agreeing only not treatment of me the gift to the 866-684-3620 (I refused to accept that it is a failure due to misuse and pay the fee), it tells me that there is nothing he can do to help me more.

    "You want me to fully waive the fee and I can't do it."

    So, I asked if there was someone else, I can speak to, superior to him.

    He then "climbed the case", and I got a call a day later, Eric, whose callback number was 877-917-4380 (unit 88). It turns out that Eric is a real, American HP customer service agent. He reviewed the notes and me (hope you're sitting) says:

    Of course, the guarantee is covered and there was no user caused damage.

    The reason I received misinformation of donation to this other number was that I asked that they also return me damaged the old hard disk (that I can try to get the data off it... see this article: http://www.geekyprojects.com/storage/how-to-recover-data-from-a-broken-hard-drive/ )

    )

    and since (the hard drive broke his back) is not included in the warranty, I was being charged for an out of warranty service.

    !!!

    I told Eric that Don does nothing of the sort. He told me that the damage to the car has been documented as being caused user and was therefore not in the warranty.

    Eric told me that misunderstood gift probably notes.

    (Strange thing is that people in India or in as much that the HP number 800-474-6836, also said that the damage is not included in the warranty and I have to pay for it. When I pressed them to find out why this is so, they quoted me the number of 866-684-3620.)

    In any case, I haggled a bit with Eric and he was quite kind to put in a special request that the repair and the former player returned to me with the machine (remember, they throw out otherwise). Indeed, it has been, and I am always grateful.

    Just a couple of points.

    (1) the gift of first wanted to charge me $270 for the new disc repair. When I refused, he says can "take labor costs on and just charge me for parts... $180. Well, google it. Road costs about $40. How honest is that?

    (2) I called this number 866-684-3620 the next day and said the gentleman who responded (this time it's Mark, not Don) what happened. In my innocence, I told him I'm relaying it so that the next time someone asks the old rear drive (I guess his commune... who wants to kick back all their data), you tell them 'it was a damaged caused user. " Well, Mark told me that he couldn't care less and would not do anything with the information that I just gave him. Would not relay it to anyone.

    Later, I realized that the number of 866-684-3620 is not HP, but the number for people to Quanta Computer, which are a company who perform repairs for HP. clearly, it is in their interest to do a repair and to be paid by the owner of the laptop, not HP. (HP does not pay $180 to replace a hard drive that cost me the retail $40!)

    Bottom Line: Don't download jostled by the people of 866-684-3620. Ask that the case "degenerate." You will get a HP person and this time an intellegent and speak English.

    For other examples of complaints of people buffeted by staff at 866-684-3620 (Quanta Computer), just google

    866-684-3620.

    At the end of the day, however, I would like to thank Eric and also HP, to fix my computer and the hard drive back.

    (By the way, the best place to get the HDD replacement PCB is: http://www.onepcbsolution.com/ .) Change the pcb often allows you to recover your data.)

  • My slideshow said opening program there is not enough space on I: but I: is an external hard drive. Why is it not open c:

    At the opening of my slide show program he says there is not enough space on I: but I: is an external hard drive. Why is it not open c: I have used before with no problems. Is there a way to force it to open it on my computers built in the hard drive?

    Hello

    1. what Slideshow program do you use?

    2. you try to open a slide show file or the program itself?

    3. If you try to open the file, then where is it?

    4. have you made a recent software or hardware changes to the system?

    If you are trying to oepn the file, then you can try to copy the file to the desktop and check if it helps.

  • When it transfers data to the microcomputer by Uart, USB etc PC, it must either be aware access to the hard drive of the PC or not?

    I want to know when it transfers data to the microcomputer by Uart PC, USB etc., it must either be aware access to the hard drive of the PC or not.
    When the Windows operating system run my programs, hard drive is accessible when there is a space of memory?
    For example, virtual memory method return page-by-page, page-out using the drive hard when memory is used in full.
    I am using Windows 7 Home Premium 64-bit. The access to my PC hard drive light flashes even though I don't run my program.

    The lamp for the drive starts flashing as the computer is running and programs are running. Windows is a program that runs all the time and access the hard disk.

  • No matter how much hard drive space or size is not displayed. It says hard drive is not accessible and the cyclic redundancy error.

    * Original title: hard drive problem

    No matter how much hard drive space or size is not displayed. It says hard drive is not accessible and the cyclic redundancy error. When I try to format it, it says windows could not finish.

    What just happened? How can I solve this problem?

    It says hard drive is not accessible and the cyclic redundancy error. How can I solve this problem?

    Sorry, you can not. A CRC error means that there is a serious problem with your drive. You need to replace it.

  • I got my product key Windows 7 enabled on my computer, then my hard drive crashed, so I had to reinstall Windows on a new hard drive. He is now not letting me turn it back on.

    original title: activation problem

    -I got my product key Windows 7 enabled on my computer, then my hard drive crashed, so I had to reinstall Windows on a new hard drive.  He is now not letting me turn it back on.  What should I do?  I don't want my computer or Microsoft thinks I use a version of Windows

    It is Windows 7 Home Premium, and I my here in front of me activation code.  But it is to say that it is not valid.

    Skip entering your product key Windows 7 and complete the installation.

    When you reach the desktop, click Start, right-click on computer

    Click on properties

    Scroll down to the Windows Activation

    Click the link x days before activation.

    Click on the link that says: "show me other ways to activate.

    Enter the product key

    Click next

    Select the Activation of the phone

    Click Next when you enter your key page

    Select your country

    Click Next, call the number listed

    Be sure to explain your situation to the Appeals Officer.

    Provide the installation generated when ID requested by the call agent

    They give a confirmation ID in return, enter it

    Click next to complete the activation.

    However, the requirements for the media upgrade is that you have an operating system already eligible such as Windows XP or Vista installed to use it. Since the Windows 7 end user license agreement.

    15 UPDATES. To use upgrade software, you must first be licensed for the software that is eligible for the upgrade. After the upgrade, this agreement takes the place of the agreement for the software that you upgraded. After upgrade, you can no longer use the software that you upgraded.

    So, if you are always denied, you will just have to reinstall Windows XP or Vista and let it do the verification of eligibility.

  • OEM version of windows 7 can be installed on a new purched from hard drive on the market and not OEM (Dell)

    My Dell laptop hard drive crashed. Now, I want to buy a new hard drive directly from the market (not dell). I'll be able to install the OEM version of windows 7 Home Basic or should I get the HARD drive replaced by dell only? I have the original DVD of windows provided by Dell.

    No, you don't have to buy the hard drive from Dell. The market will be ok...

  • Hard drive crashed and I can not turn off Lightroom

    Hard drive crashed and I can not turn off Lightroom in order to to use on another computer.

    Hi johnr.

    What version of Lightroom do you use?

    If you use the CC version, you can simply install it on any computer (if exceeds the number of activations, you'll be prompted to disable)

    If you are using the standalone version, let us know what version do you use?

    You can also contact us to contact customer service

    Kind regards

    Assani

Maybe you are looking for

  • Pane 'Inspect element' Firefox 17

    I like the component element inspect with dark background of 17 more than that in 18 with a white background.Where can I find the CSS of the component element Firefox 17 inspect?

  • Is this appropriate for a Satellite Pro 4600 memory?

    Hi all I wonder if this memory will be suitable for my brothers satellite pro 4600: http://www.ebuyer.com/customer/products/index.html?RB=24267462131&action=c2hvd19wcm9kdWN0X 292ZXJ2aWV3 & product_uid = 24226 I intend to get 2 sticks and replace the

  • Satellite L670-1EC - low connection speed WiFi - only 65Mbit/s

    Hello How can I rotate at high speed on my wifi draft n card? My TV connection to the router with speed 130Mbit/s.What is happening with the wifi card in ouer L670? In the specification is 802.11b/g/n, but it doesn't work!Where is the map? To achieve

  • Deleting a folder gives this message: check the location of the elements, and then try again

    I would like to help to get rid of a file. The folder used to hold pictures, but is now empty. I tried the normal removal methods. I also tried to remove prompt all to nothing does not. I tried to use Fileassassin, but it will not work with a folder

  • Oracle Enterprise Manager on Linux level 3?

    HelloI'm running 6 servers in tier 3 of RHEL 6.4 with Oracle 11.2.0.4 Standard Edition is installed.Because I'm on a level 3 of Linux installation, all maintenance are carried out using sqlplus command line in an SSH session.Is it possible to install