delete a virtual disk of the virtual machine of broken storage

I have a virtual disk to a virtual machine on a broken iSCSI storage,

now I can not remove the disc from the virtual machine.

ESX 4.1 does not see the now broken iSCSI storage.

See attach.

Remove the virtual machine from the inventory and edit VMX manually deleting the reference to this disk. After that, add the machine virtual back again for the inventory.

Tags: VMware

Similar Questions

  • Deletes a virtual machine of vCenter possible?

    Hi all.

    We used to be a Horizon view manual pool composed of virtual machines
    from vCenter server. In a single operation for removal of VM in view, we

    wrong selected pool and confirmed the deletion. The

    operation put merrily and when we realized the error, we

    find vsphere client that all VMs funds (a lot of them

    were running) in the manual pool view both were removed from the inventory

    and from the disc in vCenter server.

    This offends and confuses us. It is commonly accepted that it is
    Cannot delete a virtual machine running of vCenter: vSphere client no
    won't give you a possibility to do so, and doing so in a CROWD ends by default.
    But the view above disaster might suggest otherwise.

    I have two questions:
    1. is it possible to delete a virtual machine running of vCenter?
    2. If so, how to prevent in vCenter?
    3. (somewhat off topic) is it possible to come up with any hacking or

    This makes it impossible to remove vm disk Office while being

    able to manipulate the view of the pool? We prefer to rather in vCenter.

    =====================================
    The mistake that we made to remove all the Horizon view desktop VMs:
    1. login to VMware view Horizon administrator.
    2. based on the inventory, select the pool.
    3. in the view of the pool, select the tab "inventory."
    4. Select and right click on a desktop PC, select 'delete pool... '. »
    5. confirm the deletion.

    Software used:
    vCenter Server: 5.5.0, 1945274
    View of the horizon: 5.3.1 generation-1634134

    Kind regards
    Nathalie Sun

    Post edited by: sunrenjie6

    Hello Sun Nathalie,

    Finally, I was able to create your question on my test bench, but as I said earlier, it is not possible to remove a power on the virtual machine, which was true. When I deleted the pool which consists of power on VM, I saw in the VC that VM were power off first and delete.

    I also talk to the team from the horizon and they said that this device is designed this way to support several other features. To save accidental deletion of the s VM that they introduced the warning message.

    Sorry for your loss.

    Thank you

    DJ

  • How to delete a virtual machine in a script


    Hello

    I want to delete a virtual machine with a VCO script, I wouldn't use the action item named destroyVM. I explain why I wouldn't use, because in my script, I do this action:

    1. I list all VM in a specific folder name is different date servername-today ' today and powered OFF.

    2. I would destroy each VM in the list.

    But when I would simply test the following command:

    System.getModule("com.vmware.library.vc.vm").destroyVm ("VMName");

    I get the following error message:

    TypeError: Cannot read property "runtime" undefined (name of the dynamic Script Module: destroyVm #52993)

    I search on google and VMware blog, I can't find anything to help me!

    If someone has an idea, you are welcomed to answer me.

    Thank you in advance

    Good day

    Best regards

    Christophe

    Hello

    If you have access to vm.name or vm.runtime, you can access the vmobject.

    Therefore, you don't have to search again. I'm confused...

    (1.) what is folderObject?

    2.) check your if condition. It is not '&' what you want, but «&»

    (3.) getAllVMsMatchingRegexp() returns an array of vmobjects, not a single vmobject. VM names are NOT unique.

    Maybe a small example can help:

    var vmArray = VcPlugin.getAllVirtualMachines();
    for (var vmIndex in vmArray)
    {
        if ((vmArray[vmIndex].runtime.powerState == VcVirtualMachinePowerState.poweredOff) && (vmArray[vmIndex].name == "SCT-Test-01_12_2013"))
        {
            System.getModule("com.vmware.library.vc.vm").destroyVm(vmArray[vmIndex]);
        }
    }
    
  • 890124. how to move a virtual machine from one storage to another?

    Hello

    I decided to increase the RAM of a virtual machine and storage space in which stood the machine is less than 1 GB, it says that it is impossible to start the virtual machine. So I decided to move the virtual machine to secondary storage which had enough free space.

    How can I make vSphere Client aware of this change? How can I know what's happened? what I need is to boot the machine which is now moved to secondary storage. is this possible?

    THX

    After again moving data store, you must register this virtual machine to be visible in the list at left.

    1 browse the data store and open the corresponding VM folder

    2. Select the .vmx file and right-click.

    3. Select the option "Add to the inventory" and keep clicking Next until you have finished.

    4. now switch on the machine. He will ask a question that you copied or moved.

    5. Select I moved it.

    6. your machine is running.

    And you can see the virtual machine in the list after step 3 itself.

  • Questions about the archive/delete a virtual machine for later retrieval.

    We run VSphere 4.0 in a 10-node cluster.    We have a VM we want to remove the system, but we want to archive it so that we can restore it later if necessary.

    Initially, I was counting on stop the virtual machine, the navigation data store and copy the files to a local disk using the button 'Download' on the data store.  Then after the copy, by an "out of disk" on the VM on VCenter.

    Then later if we need the machine back, download the files and do a 'add to inventory' on the VMDK file.

    However, when I did the download, I noticed that VMDK files on the downloaded folder had names with "-flat" added to them.  So 'server.vmdk' became 'server - flat hard '.

    If I copy these files with the '-dish "in the name in VMWare later, they will come to OK?

    Or, given that I'm trying to (archive a virtual machine), is there a better way to do this?

    Your comments would be appreciated.

    Mike O'Donnell.

    That is right.  "Every hard disk to a virtual machine consists of a pair of files hard. One is a text file containing descriptive data on the virtual hard disk, and the second is the actual content of this disc. For example, a virtual machine named examplevm has a drive attached to it. This disc consists of a file less than 1 KB examplevm.vmdk descriptor and a 10 GB examplevm - flat hard flat file, that contains the contents of the virtual machine. ' - of Ko 1002511.

  • Deleting a virtual machine

    I'm having a very difficult time trying to find how to delete a machine virtual vcenter through the SDK (the doc leaves much to be desired). I found the method unregisterVM() of the command VimPortType (just the syntax, no explanation of what it does), but after using it, it just gets rid of the VM inventory - all files are still on the data store.

    I want to get rid of the files as well as registration in the inventory. I found a method

    unregisterAndDestroyTask() , 

    but there is also no explanation of what it actually does.

    Can someone tell me please how to get rid of a vCenter virtual computer and the data store completely?

    There is a generic 'delete' method called Destroy_Task() http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.ManagedEntity.html#destroy which is applicable to different types of objects, including a VirtualMachine, HostSyste, Datacenter, etc depdning on the object, it will do different things. For a virtual machine, it will remove the virtual machine and it has associated the disc for a HostSystem, it will just remove it from vCenter

    The UnregisterVM_Task() is just, that he cancels his registration vCenter or ESX (i) inventory, but leaves his records intact. If you want to destroy everything, you want to use the Destroy_Task()

  • Move the virtual machines to new storage device

    I recently added a storage IBM DS3200 SAS device to my VMware ESX 3.5 server.  I am running 6 VMs locally on the server and I would like to move the virtual machines to the new storage device.  I have formatted disks and the ESX Server sees.  What is the best way to move the virtual machines that currently reside locally on the external storage device?

    Thanking you in advance,

    Al

    I guess you could also try using converter

  • Is it possible to delete a virtual machine by UUID

    I'm trying to script for power down and remove a virtual machine by UUID, is it possible?

    Hi skyjacker99,

    This should work:

    Get-VM | where {(Get-View $_.Id).config.uuid -eq ""} | Remove-VM
    

    Kind regards

    Markus

  • Delete a virtual machine

    Hello

    I must be missing it.

    But where is a task of delete_vm in the managed object VirtualMachine?

    Chris

    You can use the following syntax:

    void deleteVM

    {

    my $task = $my_vm-> Destroy_Task();


    My $task_complete = 0;

    My $task_error = 0;

    My $task_view;


    until the ($task_complete)

    {

    task_view = Vim::get_view (mo_ref-online $task, properties-online ['info']);

      

    If ($task_view-> info-> status-> val eq 'success')

    {

    $task_complete = 1;

    }

    If ($task_view-> info->State->val eq 'running')

    {

    following;

    }

    If ($task_view-> info->State->val eq 'pending')

    {

    following;

    }

    If ($task_view-> info->State->val eq 'error')

    {

    $task_complete = 1;

    $task_error = 1;

    }


    sleep 1;

    }

    }

    Hope that I did typos

  • Questions about replication of virtual machines using EMC storage

    Hello

    If we have a configuration on 5200 VNX and ready to replicate to Dominican Republic

    What are EMC replication Solutions, if not use Recoverpoint?
    I have to add licenses of replication with the Suites of the app for that?

    and whether using Recoverpoint, it is essential to use SRM for replication can be configured using Recoverpoint and VNX licenses only?

    and for another program installation is with 10 GB iscsi ports, what are the possible solutions?

    Thank you

    There are several choices for replication with EMC VNX. You can use Mirrorview. MirrorView/S (synchronous) is for short distances and Mirrorview/A (asynchronous) for longer distances and time of higher latency and low latency. You will need a license from EMC Recoverpoint or Mirrorview. Recoverpoint appliances can now be virtual with version 4. ISCSI is required for a virtual Recoverpoint deployment.

    You don't have to use RS with Recoverpoint, although I would recommend that you do. SRM automates many manual steps that are necessary to retrieve your VMs. SRM will be integrated with Recoverpoint or Mirrowview and you will be able to script recovery plans. In the case of the manual recovery plans would be required and will need to be updated.

    You can also duplicate with suppliers other than EMC software. VMware has built the replication that is fine. Veeam also sells software for replication.

    John

  • AIO HP20-2002: lost disk inside the drive machine

    Disc in the DVD player has come off the tree and disappeared inside the unit. How to recover the drive?

    Hello @AusKen,

    I understand that your drive slipped inside your optical drive. The problem you describe seems to be a physical problem. Please contact our technical support at the 800-474-6836. If you do not live in the United States / Canada region, please click the link below to get help from your region number. http://www8.hp.com/us/en/contact-hp/ww-phone-assist.html.

    I want to thank you for display on the HP Forums. Have a great day!

  • Best way to move a virtual machine from local storage to iSCSI

    Migrate? Clone? Export? Other options?  No, we didn't have any iSCSI storage when we started.

    What about sVMotion?  in this way, you can perform a live migration.  If this is not the case, stop the comments and make a cold migration.  Two of these suggestions are assuming your vCenter running.

  • Remove/delete virtual machines based on creation Date

    Hello

    I'm fairly new to PowerCLI and I'm not a coder strong. I've been reviewing through communities and [web] inter and this time, Google is not my best friend.

    I'm trying to make a script that deletes VMs of the disk based on the time of creation of virtual machines and the unique string in the VM name to avoid deleting other virtual machines then those I want. I would like to modify this script to remove the AD and SCCM objects, however, it's just a list of wishes

    You may be wondering why I don't want to do something like this and the answer is for testing purposes.

    I have a group trying to test applications in a lab environment and we want to make sure that the virtual machines are removed within 3 weeks being created without doing it manually.

    Any help with this would be greatly appreciated

    Then, you could make the Where clause more specific, something like

    where {$_ -is [VMware.Vim.VmCreatedEvent] -and $_.Vm.Name -like "LAB*} | %{
    
  • The virtual machine files

    Hello;

    Just noticed that in my data store, there are several folders to a single virtual machine, e.g. VM-Marketing, it also has Marketing_1-VM and VM-Marketing_2.

    When I go on the 'change settings' of this virtual machine, in the hardware tab, and on the hard drive, it's going to [datastore] VM-Marketing_2/VM - Marketing.vmdk.

    Then in the General Options in the 'Options' tab, the Configuration of the VM tab is [datastore] VM-Marketing_2/VM - Marketing.vmx

    It seems that my VM it working in the VM-Marketing_2 file in the data store, what about the other two?, this virtual machine, it is quite heavy, it has a 80 GB HARD drive and I have 3 of them if total 240 GB, so can I remove them?, is there something I can do atin the VCenter?

    The content of this files are:

    VM-Marketing.

    -rw - 1 root root G 80, 11 October 2010 VM-Marketing - flat hard
    -rw - 1 root root 8.5 K 11 October 2010 VM - Marketing.nvram
    -rw - 1 root root 480 11 October 2010 VM - Marketing.vmdk
    -rw - 1 root root 0 11 October 2010 VM - Marketing.vmsd
    -rwxr-xr-x 1 root root 3.1 K 11 October 2010 VM - Marketing.vmx
    -rw - 1 root root 268 11 October 2010 VM - Marketing.vmxf
    -rw - r - r - 1 root root vmware.log K 85, 11 October 2010

    VM-Marketing_1 /.

    -rw - 1 root root G 80, 11 October 2010 VM-Marketing - flat hard

    -rw - 1 root root 8.5 K 11 October 2010 VM - Marketing.nvram

    -rw - 1 root root 480 11 October 2010 VM - Marketing.vmdk

    -rw - 1 root root 0 11 October 2010 VM - Marketing.vmsd

    -rwxr-xr-x 1 root root 3.0 K 11 October 2010 VM - Marketing.vmx

    -rw - 1 root root 268 11 October 2010 VM - Marketing.vmxf

    -rw - r - r - 1 root root 70K 11 October 2010 vmware - 1.log

    -rw - r - r - 1 root root 73K 11 October 2010 vmware - 2.log

    -rw - r - r - 1 root root vmware.log 73K 11 October 2010

    VM-Marketing_2 /.

    -rw - r - r - 1 root root 17 37 Sep 12:37 VM-Marketing - 4db56dd6.hlog

    -rw - 1 root root 6.0 G Sep 19 08:16 VM-Marketing - 4db56dd6.vswp

    -rw - 1 root root 5.1 M Sep 19 08:16 VM-Marketing - ctk.vmdk

    -rw - 1 root root 80G 19 Sep 13:59 VM-Marketing - flat hard

    -rw - 1 root root 8.5 K 19 Sep 08:17 VM - Marketing.nvram

    -rw - 1 root root 568 Sep 19 08:17 VM - Marketing.vmdk

    -rw - 1 root root 13 Sep 07:27 VM 1.4 K - Marketing.vmsd

    root - rwxr-xr-x 1 root 3.4 K 19 Sep 13:19 VM - Marketing.vmx

    -rw - 1 root root 268 Sep 19 13:19 VM - Marketing.vmxf

    -rw - r - r - 1 root root 245K 7 September 08:52 vmware - 20.log

    -rw - r - r - 1 root root 155K 17 Sep 12:32 vmware - 21.log

    -rw - r - r - 1 root root 133K 17 Sep 12:37 vmware - 22.log

    -rw - r - r - 1 root root 128K Sep 19 07:52 vmware - 23.log

    -rw - r - r - 1 root root 61K 19 Sep 07:56 vmware - 24.log

    -rw - r - r - 1 root root 61K 19 Sep 07:58 25.log - vmware

    -rw - r - r - 1 root root 90K 19 Sep 13:20 vmware.log

    Thanks for your time...

    Welcome to the community - VM when is created ESX, it will use the name of the default computer name of directory where the virtual machine and its files will be stored - if a directory with that name already exists, it increments the directory with _1, _2 etc - so I am betting by the same VMs na, e were created before the one you have currently in production - Maybe the intention had been to delete these virtual machines, but when they have been deleted, rather than by selecting delete from the disk - remove inventory has been selected which will keep the directory structure.

  • Clone a virtual machine / move to folder / delete VM / as a Powershell Script as a scheduled task ends with "ongoing"

    Hi all,.

    I would kindly ask your help with a script that needs to run as a scheduled task. It is functional, but does not correct and little need for love at the end...

    I want to create a script that

    • find a virtual machine with a pattern on its behalf (realized and works)
    • delete a virtual machine with a reason given in his name (completed works)
    • create a clone of a virtual machine (completed works)
    • move that created clone (upstairs) and move it to a folder named (open)
      or the fact in the clone process

    I realized thus far:

    Add-pssnapin VMware.VimAutomation.Core
    # Import CSV backup
    $backupinfo = import-Csv C:\scripts\vm_backup\test.csv
    VCenter servername #Set
    $vcenter_server = "name servers".
    #Connect to vCenter
    SE connect-VIServer $vcenter_Server

    # BEGIN OLD BACKUP CLEANUP
    #Select all old backups
    $old_backups = get - VM *-backups
    {if ($old_backups)}
    {foreach ($backup_vm to $old_backups)
    Get - VM $backup_vm | Remove-VM - DeleteFromDisk-confirm: $false
    }
    }

    # START QUEUING NEW CLONES
    #Increment through CSV
    {foreach ($customer to $backupinfo)
    $target_host is get-VMHost-name $customer. TargetHost
    If {($target_host)
    Date format #Set for clone names
    $date = get-Date-Format 'YYYY-MM-dd ".
    Date format #Set for emails
    $time = (get-Date - f "Hh: mm")
    #Get SourceVM
    $vm is get - VM $customer. SourceVM
    # Create new snapshot clone
    $cloneSnap = $vm | New-Snapshot - name "instant Clone.
    # Get the managed object display
    $vmView = $vm | Get-View
    # Get the managed folder object reference
    $cloneFolder = $vmView.parent
    # Construction specification clone
    $cloneSpec = new-object Vmware.Vim.VirtualMachineCloneSpec
    # Make linked disc specification?
    $cloneSpec.Snapshot = $vmView.Snapshot.CurrentSnapshot
    #Set VirtualMachineRelocateSpec
    $cloneSpec.Location = new-object Vmware.Vim.VirtualMachineRelocateSpec
    #Thin commissioning
    $cloneSpec.Location.Transform = [Vmware.Vim.VirtualMachineRelocateTransformation]: sparse
    #Target data store
    $cloneSpec.Location.Datastore = (get-Datastore-name $customer. TargetDS | Get - View). MoRef
    #Target host
    $cloneSpec.Location.Host = (get-VMHost-name $customer. TargetHost | Get - View). MoRef
    #Target list of resources, from the first VM in the TargetHost
    $cloneSpec.Location.Pool = (get-VMHost-name $customer. TargetHost | Get - VM | Select-Object - 1 first | Get - View). ResourcePool
    Name of clone #Set
    $cloneName = ' date of $vm-$- $temps - backup ".
    # Create clone
    $clone_task = $vmView.CloneVM_Task ($cloneFolder, $cloneName, $cloneSpec)
    # Remove snapshot created for clone, will automatically queues
    Get-Snapshot - VM (VM-Get-name $customer. SourceVM) - name $cloneSnap | Remove-Snapshot - confirm: $False
    }
    }

    # Move folder in VM Clone
    Move-VM - VM * - backups - Destination Clone

    VCentre #Disconnect
    Disconnect-VIServer-confirm: $false

    The script itself runs so far and does what it should, but the scheduled task is always "in process of execution". Now, I created a work around in this way, I have finished the task after two hours of running; but there must be a better solution that works properly.
    As well as the part with the rise of the virtual machine.

    Could you maybe help me or have a good idea how to solve this problem?

    Thanks in advance

    Try again with

    PowerShell-no interactive - noprofile - executionpolicy override - file C:\scripts\scriptname.ps1

Maybe you are looking for