Help syntactic hard drive Remove

Hello

I try to remove the specific hard drive using the cmdlet Remove-disk hard in powercli and do not understand the correct syntax.  On the link below, he said that, with the parameter - hard disks, you can specify the drives that you want to remove.  However, I get an error when you try to publish the syntax below what return "cannot bind parameter ' hard drive." Unable to convert the value. "Any information would be greatly appreciated, unfortunately VMware deosn have any good examples on the Site of order.

Get-disk hard - VM $vmname | Remove-hard disk - disk hard 'disc 1' - DeletePermanently

Get-disk hard - VM $vmname | Remove-hard drive - HDD "[Datastore] vmname/vmname.vmdk"-DeletePermanently

http://www.VMware.com/support/developer/PowerCLI/PowerCLI41/HTML/index.html

See you soon!

-LzK

Hello, THEL1ZARDKING.

You were pretty close.  I've written a few examples that use different settings in different ways, to try to illustrate their use.  Here are some ways that should work:

## remove a harddisk based on its "name" according to the VM, such as "Hard disk 1" or "Hard disk 2"Get-HardDisk -VM $strVMName | ?{$_.Name -eq "Hard disk 1"} | Remove-HardDisk -DeletePermanently

## a variation, again based on the disk's "name"Remove-HardDisk -DeletePermanently -HardDisk (Get-HardDisk -VM $strVMName | ?{$_.Name -eq "Hard disk 1"})

## remove a harddisk based on its datastore pathGet-HardDisk -Datastore "Datastore" -DatastorePath "[Datastore] VMName/VMName.vmdk" | Remove-HardDisk -DeletePermanently

First line you just need a little tweaking, or the first example the second above.  Your second line could be changed a little, either to be like the second or third example above.  The key is by passing a disk object hard VI to Remove-hard drive, either through the pipeline (e.g. 1 and 3), either explicitly (e.g. 2).

How to make them for you?

Tags: VMware

Similar Questions

  • 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.

  • 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.

  • How to backup to external hard drive (removable) for windows home server 2011

    Your online help recommend ' to use several external hard drives and rotate the drives between onsite and offsite storage locations", but there is nothing that explains the procedures to be put in place. I have vascular 1 internal disk used as a server backup and the desire to attach a USB key and also back up the server and remove location and still allow regular backups to take place on the interal drive.

    Hi JarjarMack,

    Given that the problem is related to Windows Home Server 2011, for better assistance, you must post your query in the following Windows Home Server Forum.

    Windows Home Server Forum

  • backup to external hard drive, removal of the movies on computer?

    I want to know if I got back to the top of my itunes library on an external hard drive I can remove my itunes on my computer movies to save space on this subject? It is my friends computer and I don't want to take up space. And then I still see them on my apple TV if the movies are not on my internal hard drive?

    I am new to this and I wanted to know if my apple tv can stream after I deleted movies from my computer? I have no idea how it works, as far as I know I need to get back to the top of my purchases...

    Backup and deletion are not back up. Backup is always to have two copies of everything, preferably on completely separate players in different locations.

    In order to play something through iTunes, it must be added to iTunes.  You can add files from a separate iTunes drive and make them stay on the player by holding down the option key while adding, but there may be painful to see broken links if the drive is not attached when using iTunes constantly.

    You can listen to an AppleTV iCloud films apparently, but I can't provide details.  This should work for you, unless it's one of those elements is no longer in the Apple Store (and your reason to always make sure that you have a copy on your hard disks).

  • Should I buy the hard drive removable 750Go for the Y500 series laptop?

    I know that it includes a hard disk of 1 TB inside the laptop

    but you think that it is necessary to buy a?

    OK the y500 series have the Bay ltration that allow to use the removable hard disk, graphics etc.
    I mean that play games (not many) games maybe 2 or 3
    Record a movie in the drive about 250 to 270 GB
    Don't forget the y500 I already have 1 to inside
    The removable hard drive was a 720 GB external drive which can use for ultra Bay

  • Pavilion g6-2165sx: * URGENT Please HELP * short hard drive DST has no error RU773W-68R81S-MFPX1G-60W803

    Hello my problem occurred as a result of the creation or modification of partitions to install ubuntu (for reasons of college) however I stupidly didn't check my disk was dynamic or basic and unfortunately it was dynamic, if after failing to install ubuntu windows 10 had an error in INACCESSEBLE_BOOT_DRIVE when I oppened the cmd troubleshooting and checked on diskpart did not exist but with a status unknown after dvd player I made the diagnosis and that he got a short DST has not... Is there a chance to correct the reader because im out of warranty and im in no condition to buy a new hard drive... Thanks in advance

    @Alin742

    Go to this site and create a bootable CD.

    http://hddguru.com/software/2005.10.02-MHDD/

    Boot from the CD.

    If she asks do you want SCSI, click No or just press ENTER. (countdown to 30 seconds)

    The port selection select your HARD drive. (Usually 1, 3 or 6).

    If you do not see your HARD drive, you will need to restart and go into the BIOS and SATA ATA value.

    After choosing your type of HARD drive, ERASE and press to enter. (This will erase all data).

    Leave it to erase the entire disc. (Depending on the size, it may take 2 to 5 hours.)

    Once done erase all disk F4 2 hit shots and will start the test.

    Many people simply replace the HARD drive and all that is wrong is there is simply soft errors. (Errors caused by software not hardware errors.)

    If you need help running the program let me know.

    REO

  • Help with hard drive

    I have a problem with Windows 7 and recently bought a HP p6-2133w with Windows 7 installed, I need to download and to make operational a piece of software which is not compatiable. Wanted to Crash Windows 7 and install XP instead, but it was a no go. Can you help and tell me how to plant this hard drive. Also tried to install another hard drive and install the system and she always do it?

    Answers?

    Marv,

    Thank you very much. You can try to offer KUDOs as you like ;-)... I appreciate it. Please mark this as RESOLVED issue. In my view, that it was launched by another username of "marverdman". You have to login with this name to mark the thread.

    Frank

  • Hard drive - Remove Metadata?

    I recently reinstalled Windows XP Home Edition on an old laptop when replacing the hard drive.  All updates have been installed.  After about a month of 'perfect performance', I think the hard drive now has as many metadata on it because it has "normal" files  Over the years, I have never seen this before and have two questions:

    a. how she came here?

    How can b. I clean off?

    I note that there are some items of 'cleaning up' on the basis of knowledge, but I can't really follow the instructions and, in any case, none seems to refer to "build up" on a hard drive.  All suggestions will be welcome.

    Helpster: and any other interested party.

    The problem of the 35 GB metadata that appear on my hard drive was healed!  Although I don't understand why.  Playing with virtual memory settings, I selected "No. Page File" but not clicked on "Set".
    The re - inspected, virtual memory had restored his last, "Allow system to manage", BUT chcking on the hard disk, ALL the excess metadata had been cleared.  With the help of Auslogics program to clean the hard drive, then found more than 1300 Junk Files that had not been previously noted.

    It is assumed that the swap file had been corrupted somehow.

  • External hard drive - Remove write protection

    Somehow, I write protect my external hard drive. How can I remove it? I thank in advance

    1. click on start

    2. type regedit and click OK.

    3. save your registry settings by clicking file > export > save. It's taken bacup in case something mess.

    4. Open HKEY_LOCAL_MACHINE click on the + sign next to the it.

    5. open SYSTEM by clicking the plus sign next to it.

    6. open CurrentControlSet.

    7. open the control.

    8. open StorageDevicePolicies

    9. right click on WriteProtect and click on modify.

    10. If the value is 1 change 0, and then click ok.

    11 repeat steps 7 to 10 for ControlSet001 and ControlSet002.

    12. close the registry editor and its done. You may need to restart.

    Carey Frisch

  • Help with Hard Drive and registry

    Hey, it kinda turns out to be a long and difficult history, but I recently had a small problem that spread to a problem much bigger (and catastrophic).

    I had a problem with freezxing on my laptop (HP Pavilion Dv5 with the 64-bit version of Vista I think). I've tried a few things m ais it froze just in case. Finally I found someone who said they ran a registry cleaning program and that did the trick. I tried and I had no more freezing. Unfortunately, I connected an external hard drive and all hell broke loose. It froze and I turned off the laptop. I have it turned on and was greeted with this message:

    STOP: c000021a {Fatal System Error}
    The Session Manager failed to create protected prefixes system process terminate
    d unexpectedly with a status of 0x000003a (0x00000000 0x00000000).
    The system has been shut down.
    

    I tried to boot in safe mode and found:

    STOP: c0000218 {Registry File Failure}
    The registry cannot load the hive (file):\SystemRoot\system32\config\SOFTWARE or its log alternative.
    It is corrupt, absent, or not writable.
    

    Then, she went and made the collection of data, and that was all. After that, I tried the boot recovery option and that never worked. I searched internet and found a few people with similar, but never the same questions. Someone, somewhere, says something about execution of system restore after having access to the menu by pressing F8 at startup. I tried. It did not work. I pressed F8 at startup upward and chose the first option. It has established a list of things to try. System Restore (and other options such as checking memory and bring up the command prompt) did not work because the C drive has been used. Large. I tried to use the disks that came with my laptop and I never once found while they were actually useful because I could never the laptop to run.

    Now, I wanted to try to use the command prompt. Never really had a chance. Now, when I start the computer I'm greeted by the inspiring message of hard drive are not.

    Sweet. Now, I'm a little stuck on what to try. I tried to reset the BIOS defaults and nada. I have no idea what it must try now and would love to help anyone.

    I would be very happy and I thank you for your time.

    It depends on how much you have to pay to get the new hard drive installed and running. Get a quote for a computer shop trust you.  So I think that if the computer has been done what you wanted to do before he went wrong.  If it was enough for you and the price of the repair is not too high (maybe less), I would. If the price is more than $ 200, I would start thinking about applying your money towards a new laptop computer, but that cheaper isn't always the best deal.  Do some research and try some mobile friends to see if it is fast enough for you and you enjoy the feeling. Stop in some stores that display laptops and taste. Laptops with dedicated video card memory will do better with the games.  If the games are starting to become important to you, consider a desktop computer instead of a laptop where you can buy a killer video card. I like the new Ivy bridge to intel for laptops so look for it.  This is the new family of Intel processors. I7 Ivy bridge is the finest, then the i5, then the i3.  You really need to sit with someone who knows computers and discuss your needs for the future and how you want to use your computer.

  • Warranty question - HARD drive removal

    One of my friends has a Pavilion g6-2301sm laptop and the laptop suffered a fan failure. The warranty is still valid, but I thought it would be a good idea to remove the HARD drive to eliminate all risk of damage to it during transport and so the guy working at the service could not access it.

    My question is, I could void the warranty if I removed the hard drive? The laptop is in perfect condition, never fell, not a single sticker removed.

    Removal/replacement of the hard disk (normally is) considered tasks routine owner and guaranteed would be cancelled as such no. Many times HP will send even to the client a hard drive replace hard drive, instead of sending in the machine failure.

  • How to find files of outlook data on a hard drive removed from a windows xp machine?

    My phone no longer works and I was able to get most of the data of my backups that they did not understand my outlook e-mail accounts. I have the removed disk and got a hard drive enclosure. Problem is that I can not locate the outlook.pst file. Do you know which directory it is?

    The default location is C:\Documents and Settings\YourUserNameSettings\Application Data\Microsoft\Outlook and the default name is Outlook.pst

    You can place Outlook files anywhere that you want so you will have to search for *.pst to find them all [assuming you have created several].

    If you want to put them in a place which is included in your backups in Windows 7, then:

    1 close Outlook after consuming at least once [the file is created on first use].

    2. go in C:\Users\yourusername\AppData\Local\Microsoft\Outlook [you must show hidden files to reveal the path to get there, or you can simply paste the path into the address box of Windows Explorer to join directly the]

    3 move the Outlook.pst you will find at a convenient location in My Documents.

    4. open Outlook.  Will report you that it cannot find Outlook.pst and will give you the ability to browse for it then point to where you put the file.  [When you open Outlook, it will look at the new location without asking any other]

  • NEED HELP! Hard drive failure Alienware 17

    When I start my computer it really takes a lot of time for anything to be taken and eventually I get a blue screen and the process restarts itself. So after a few violins and research, I found out how to run diagnostics.

    That's what I got when my hard drive failed the test

    Error code: 2000-0142

    Validation: 70303

    Please help, it's been a few months since it happened to save enough money to get a new hard drive. I just bought 3 Witcher in time and I'm sick of not being able to play you will understand my urgent need for assistance.

    Hello

    Unfortunately, this error can mean a hardware failure with the hard drive. The recommended procedure is to replace the hard drive. If your system is under warranty, send me a PM with your service tag to get help.

  • M9350f hard drive removal

    Hi I had a few problems with the removal of my hard drive. I watched a video on my model specific to the HP Web site and followed to the letter, but ran into a problem. HP personal media drive Bay is connected to the hard drive bay for remove you after you the 2 screws you have to push a button/lever with a long screwdriver that will open the entire Bay. In the video he just pressed the button and it is well. In mine, she would not loose so I put a force in it and something gave... I watched it and the thing the metal tab I had to press a been slightly bent... and the entire Bay is still stuck. Any suggestions?

    Yes I did, and Yes, this is the video. I sat with her again and was and realized that I had to drag the entire Bay up in order so he can detach and be able to be released. I did notice this in the video because he did it quickly and not explain it. And the little thing tab was not too badly bent and it doesn't really have anything to do so it's all good. Thanks for the quick response. This is now SOLVED.

Maybe you are looking for