Question to delete the virtual machine

Hi all

ESXi 4.0 and 4.1

1. when I "delete VM from disk", why sometimes the record (with disk vmdk files) are not deleted? Is this a normal behavior?

2. If the size of the virtual machine is 100 GB, can I expect that there will be 100 GB of space released in the data store?

Thank you.

Fajar.

(1) why vmdk can be detached? What is the cause?

1 - in fact the only one - is that the virtual disk has been manually detached.

(2) why ESXi don't simply delete the entire folder when you are prompted to "remove disc"? You can probably avoid this kind of problem.

For security reasons, only files that are known to belong to the virtual machine will be removed. The problems you get with deleting too many files is generally much more severe than the one you if a file is not deleted.

I check the file against the inventory, but it becomes tiring when the folder is located in the shared data store, I check against several hosts.

In 99% of cases (have you seen, I did not use the word "generally") ' delete drive ' will delete all files related to the virtual machine. In the case of a shared storage you don't have to check on each host, since, in the majority of cases (again once I have use 'usually) all guests have access to the same storage.

Another reason why the - mainly the vmdk files - files cannot be deleted, is when they are locked. For example, by a hanging backup process.

André

Tags: VMware

Similar Questions

  • Delete the virtual machine to the specified date

    I'm trying to write a script to remove a virtual computer on a certain date.  Currently, I want people to add this in the name of the virtual machine "VMname_Delete-/ 1/1/14", I then search for the virtual computer with:

    Get - VM | where {$_.name - cmatch "Delete-\d\/\d\/\d"}

    With that, I'm sure that the correct VM is selected, and I tested it with virtual machines to make sure.  Now comes the hardest part (at least for me), I want to take the date to which belongs the VM name, convert it to a DateTime and then compare it to the current date.  If they match, I want to remove the virtual machine.  I tried something in the sense of:

    Get - VM | where {$_.name - cmatch "Delete-\d\/\d\/\d"} | foreach {$_ .name-split "-"}

    Which of course divide the table edge, and on tests, I had an output similar to:

    VM_Delete

    01/01/14

    Of course, now I don't know how to finish the rest.  I thought that the script would be something like:

    Get - VM | where {$_.name - cmatch "Delete-\d\/\d\/\d"} | {foreach}

    If (($_.name-split «-»)-[DateTime] - game (get-date-format ' MM/dd/yy'))

    {Remove-VM - VM $_ - DeletePermanently}

    }

    I don't see the logic in my head, but of course, I just can't write they way I think it should go.  Any help is appreciated.

    Perhaps you could do something in this direction

    $now = get-Date

    Get - VM | where {$_.name - cmatch "Delete-\d\/\d\/\d"} | {foreach}

    $dt = [datetime]($_.) Name.Split('-') [1])

    If ($dt - lt $now) {}

    Remove-VM - VM $_ - DeletePermanently

    }

    }

    With the use of the index ([1]), we select the date part of the name of the virtual computer.

    Then we have "cast" the string into a DateTime object.

    Note that typeface could cause problems, depending on the culture settings you use.

    Worse, divide you the date on the character string ' / ' and then generate the DateTime object as follows

    $now = get-Date

    Get - VM | where {$_.name - cmatch "Delete-\d\/\d\/\d"} | {foreach}

    $dummy, $year $day, $month = $_. Name.Split('-') [1]. Split('/')

    $dt = get-Date-day $day - month $month-year $year

    If ($dt - lt $now) {}

    Remove-VM - VM $_ - DeletePermanently

    }

    }

  • Change the amount of vCPU in vCD deletes the virtual machine network connection in vCenter


    It is a problem of crazy that we discovered, and I wanted to know if anyone had seen him.

    First of all, we miss the following software versions:

    vCD: 5.1.1.867405

    vCenter: 5.0.0 Build 913577

    ESXi: 5.0.0 build 1024429

    If you go to vCloud Director and change the material properties of an existing virtual machine (Powered off) any change in the amount of vCPU (to something new), inside of vCenter status of the network will change to the port group Standard (inactive) none.


    Even if, before making the change, the virtual machine is connected to a distributed port group, and works well.

    We now display an SR to VMware, but sometimes it is worth running this by the community to see if other people have already seen or indeed want to test on their deployment.


    Thanks in advance

    We have solved the problem now.

    The reason why that we faced this problem is because we used the wrong order in the API.

    You must ensure that you use the undeploy command when you work with the vCD API otherwise you end up with a disconnected network card.

  • WS8... Delete the virtual machine list

    I have 8 Workstation for Windows (running on Windows 7 x 64), just put at level towards the new generation today. The other day, I deleted a VM by going to my directory and just delete the VM folder. Now 8 Workstation, it still shows the VM it but when I click it, it gives me an error (not found) as it should.

    If I right click on this missing virtual machine, it gives me just an option to play. How can I remove these virtual machines in the list if there is not a virtual machine it more? Is there a file I can edit or a parameter somewhere? I have searched but can't see to find.

    I am looking for and looked through 10 pages here and not see this question, unless I missed it, so please give me a link and close this post.

    Thank you!

    Edit
    C:\Documents and Settings\userApplication Data\VMware\inventory.vmls

    and if still necessary
    C:\Documents and Settings\userApplication Data\VMware\preferences.ini

  • Impossible to delete the virtual machine that is stuck at 95%, can you all help me to solve this problem.

    delete.jpg

    Thanks for the help guyz, I restarted the virtual service centre and the problem was solved.

  • Automatic deletion/removal of the virtual machine to inventory

    Hello

    I need to create a clone of a virtual machine once a month on the storage separate from the original machine. Before that the time has come for the next monthly clone I have to delete the virtual machine but also to remove the inventory. I need to do without leaving the clone deleted in an orphaned State as the next clone turns out to be defective for the double.

    I set up a scheduled task to clone the machine then next month a cron job to run a vmware-cmd - s unsubscribe & lt; path to vmx & gt; followed by an rm - r & lt; path to vm & gt;. It does everything I need except remove the virtual virtual machine inventory.

    Did someone knows a way to remove it completely (as if to make a destroy) or cloning without adding it to the inventory (this is not really a need for us).

    Any help would be great,

    Mick

    With the command: vmware-cmd - s unregister

    You will need to restart the mgmt-vmware and vmware-vpxa service in order for the front end to pick up the change.

    Or you can use VC SDK.

    For VI Perl Toolkit:

    http://www/support/developer/viperltoolkit/viperl15/doc/vmregister.html

    Perl vmregister.pl - url https://vchost/sdk/vimService - username - Word blah administrator password - transaction undo - vmname TESTVM

    PowerShell (but in this example, the virtual machine is removed):

    http://myitforum.com/CS2/blogs/yli628/archive/2008/08/19/PowerShell-script-to-remove-virtual-machine-from-VMware-infrastructure.aspx

    André

  • Cannot specify a directory for the Virtual Machine

    I'm new to ESXi naked with me.  I added some records and then to browse the data store and I added the folders in there to specify the different VM..., I have a XP Win7 folder folder, etc.  When I go to create a new Virtual Machine gives me only the choice to select a data store to store the HARD drive and not the folder structure I created in the data store.  Now I can delete the virtual machine to inventory, return to 'Browse the data store' and move the files, and then add the VMX file in the inventory, but it just seems like a pain.  Am I missing something?  Really can not be complicated to arrange your virtual machines, it can?

    Yes, you cannot specify a folder when you create a virtual computer to a data store.  I guess that he has not considered to organize things at this level and honestly.  Organization is really in the 'models and virtual computers '.

  • Move the virtual machine in another data store

    I don't know what's going on, I have two data warehouses and I moved my vm from one to the other, I had to create a new virtual machine to import the files migrated, when I opened the store of data for import only saw two files vmdk files, the first 00001 others a single vmdk file that contains 00 001 not opened when you import the second succeeded, but when the server starts, it goes up a very old version, as if it was newly installed windows 2003, I saw in the dishes, delta files files but don't know what to do, I tried to check the Snapshot Manager, but did not find anything there.

    Have you ever tried to fix things? The attached .vmx file points to the correct instant hard file (scsi0:0.fileName = "Cezzanne - 000001.vmdk"), but the parentCID in this hard file is not correct!

    In any case, after replacing "Cezzanne - 000001.vmdk" with that of archive attached, you should be able to restart the virtual machine. BTW. You can delete the file «.lck...» ». This is necessary on a NFS datastore.

    Next time you copy a VM, do not create a new virtual machine. Only delete the virtual machine to inventory before moving and after moving it, click right the VM .vmx file and choose "add to the inventory.

    André

  • script to remove all the virtual machines in a folder or a group resource

    Someone at - it a script that will find all the virtual machines within a file or a group of resources and then delete the virtual machines?

    If you're dealing with a specific resource pool or a folder, you can use these.

    $vmlist = get-folder -name "TEST2"  | get-vm
    $vmlist = get-resourcepool -name TestServers | get-vm
    

    And then send it to something like this

    $vmlist | ForEach {
         If ($_.PowerState  -eq "PoweredOn")
              {
              Stop-VM -VM $_.Name -Confirm:$False
              }
         Remove-VM -VM $_.Name -Confirm:$False      }
    

    Also to find files of type VM

    get-folder -name | where {$_.IsChildTypeVM -eq "True"}
    

    Do you need to search the children files or resource pools as well?

    Dave

    VMware communities user moderator

    Now available - vSphere Quick Start Guide

    You have a system or a PCI with VMDirectPath?  Submit your specifications to Officieux VMDirectPath HCL.

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

  • Correctly remove resources when the virtual machine is deleted

    Hello

    I've created a service plan to power off the virtual machine and delete the vcenter.  The workflow works very well, but apparently not released the vRA resources.

    Then he said: the virtual machine has actually deleted vsphere, but since the vRA, Managed administration portal machines, I found the virtual machine that I removed from the service by using the mentioned service blue print now appears as "missing."


    My question is how to downgrade the machine virtual and also removed its resources reserved correctly?

    Thank you

    Jimmy

    Hi, Jimmy - I met the same problem recently and did the following:

    1. download the VC:VirtualMachine object.  This can be done in several ways, but in my particular case, I use the com.vmware.library.vc.vm.getAllVMsMatchingRegexp module.

    2. get the VCAC:VirtualMachine of the object to VC:VirtualMachine object.  Still, there are different ways to do this.  I created a getVCACVm action, which takes a #1 VC:VirtualMachine object:

    var vCACVm = null;

    var uuid = vcVM.config.instanceUuid;

    var vCACVms = Server.findAllForType ("vCAC:VirtualMachine", "VMUniqueID eq '" + uuid + "'");

    If (vCACVms.length == 1)

    vCACVm = vCACVms [0];

    Return vCACVm;

    3. delete the VCAC:VirtualMachine entity.  You can use the com.vmware.library.vcac.deleteEntity module to handle this.

    KEEP IN MIND... This removes only the vCAC/vRA entity.  You should always turn off the virtual machine (if any, see: library/vCenter/Virtual Machine management/Power Management / power off the virtual machine and wait) and delete vcenter (see: vCenter/library/Virtual Machine management/Basic/remove virtual machine).  I do this before performing the three steps above.  He there maybe better, easier, faster, etc., ways to do it.  I hope this helps.

  • We have configured replication vsphere in our environment and when replication is triggered according to the OFR start us below the questions on the virtual machines that are configured for replication

    Question: We have configured replication vsphere in our environment and when replication is triggered according to the OFR start us below the questions on the virtual machines that are configured for replication.

    Version for esxi: Patch 5.1 level 7

    Virtual center of version 5.1

    Source of storage - IBM v7000

    Destination storage - Hitachi


    Questions:
    Events of breach RPO
    Consolidation for the VM disk failure
    Delta abandoned events
    Time change events
    NTFS error and warning (event ID: 137, 57)
    RDP disconnect and ping does matter
    Standby error
    Volsnap error
    Stop the server and offline issue
    Install vmtools emits automatically

    well, in this case, we need to disable the standby of the end of the replication.

    So that everything in triggering replication does not trigger the snapshot of the suspension.

    Then test the if you get these errors.

  • virtual machine cannot start, because the snapshot of the virtual machine has been deleted by mistake.

    virtual machine cannot start, because the snapshot of the virtual machine has been deleted by mistake.

    When I start this virtual machine, it prompts: unable to find the 0001.vmdk, this disc is my shot, has been deleted by mistake.

    How to restore this virtual machine.

    You need help with a revival of the 000001.vmdk deleted or do you want to repair the virtual machine so that it works without the snapshot?

    The last option, follow these steps:
    remove the virtual machine from the inventory and edit the vmx file so that it uses the basedisk. Then add the virtual machine to inventory.
    If you need data from the snapshot call me through Skype "sanbarrow" - I may be able to help

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

  • Will the virtual machines in the space are automatically deleted when the protected group are removed

    Hi friends,

    Will the virtual machines in the space are automatically deleted when the protected group are removed?

    Thank you.

    Hello

    When you choose to delete the Protection Group, first virtual machines are unprotected and placeholders are deleted.

    Michael.

Maybe you are looking for