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.

Tags: VMware

Similar Questions

  • AutoSave is slow when the virtual machine is not active

    When I actively use a Windows 2000 Server VM and AutoSave is triggered, it's very fast.  But if I did not use the virtual machine for a while, it takes some minutes and minutes.  If I'm trying to go back to the virtual machine, I have to wait indefinitely for the automatic backup complete.

    Is it possible to set the priority for the automatic backup feature?

    Are you talking about VMware Fusion AutoProtect feature, or something else (perhaps in the comments)? Offhand, it seems that when you have not used within a certain time, Fusion got paged out. Taking the automatic snapshot requires paging backward, which can take some time. You can test this theory by looking at activity monitor and looking at the pageout/publication numbers when you see an automatic preview slow.

    Pageouts and pageins are controlled by OS X and not something we have control over. Adding RAM to the Mac, it is more likely merger will stay in memory and avoid this situation.

  • How to change the network when the virtual machine is connected, in Vmware ESXi with Perl in Linux?

    Hello

    If someone can answer that the way to change the network of a VM with Perl? I would periodically change the network where the virtual machine network adapter is connected.

    Thank you

    Take a look at the vGhetto repository of scripts, where you can find a lot of useful scripts, including updateVMPortgroup.pl , which may contain what you are looking for.

    André

  • Can I download can imagine them in the data store when the Virtual Machine is running

    or do I have to stop the Virtual Machine first and then download?

    Rgds

    Chris

    If you want to have a consistent state, Yes.

    If you just need a consistent state to the accident, you can create a snapshot, download the base vmdk files and then validate once again the snapshot operation.

    You cannot download files in use (except the read-only).

    André

  • Migration of storage when the virtual machine has several data stores

    How can I (or can I) use Storage vMotion on ESX4.0 U1 to migrate part of a virtual computer to a new data store?  I have a virtual machine with 5 data stores attached and move 1 data warehouses to a LUN of larger size.  What is the best method?

    On the "Select the data store" window, click on the button "Advanced". You can specify the location of each VMDK and configuration files.

  • Allocation of resources to the virtual machine over time

    I took trying to graph on the planning capacity in time for our clusters.

    Allowance only for the time being, use maybe later. Try trend how we allocate vms (spikes).

    I care about the elements are:

    Physics: Amount of processors in cluster, physical amount of RAM in the cluster - Total (at some point? don't think it's possible, but it would be nice)

    This part is less of a problem, I have something that works for this.

    Virtual: amount of virtual processors, RAM allocated - Total for each month

    The code has been changed on this topic (thanks, LucD!) and even more of various other segemnts.

    This makes me a nice referential list created of the time to work with:

    $SQLSERVER="MYSQLSERVER"
    $Database="VCDB"
     
    $SqlConnection = New-Object System.Data.SqlClient.SqlConnection
    $SqlConnection.ConnectionString = "Server=$SQLSERVER;Database=$DATABASE;Integrated Security=True"
     
    $SqlCmd = New-Object System.Data.SqlClient.SqlCommand
     
    $SqlCmd.CommandText = "select distinct lower(vm_name) AS vm_name, max(create_time) as create_time " +
                             "from VPX_EVENT " +
                             "where     (event_type like '%.VmCreatedEvent' or " +
                             "          event_type like '%.VMClonedEvent' or " +
                             "          event_type like '%.VMRegisteredEvent') " +
                             "group by vm_name"
    $SqlCmd.Connection = $SqlConnection
     
    $SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
    $SqlAdapter.SelectCommand = $SqlCmd
     
    $DataSet = New-Object System.Data.DataSet
    $SqlAdapter.Fill($DataSet)
    $SqlConnection.Close()
    $DataSet.Tables[0] | Export-Csv c:\vm_create-list.csv -NoTypeInformation
    

    Now that there is a file with the dates, I can use to reach the given date to an allocation of resources aspect:

    $creationtimes = Import-Csv 'c:\vm_create-list.csv'
    
    $realvms = Get-View -ViewType "VirtualMachine"
    
    $myCol = @()
    
    foreach ($item in $realvms) {
         
         $Row = "" | Select-Object CreationTime, NumCPU, MemoryMB
         
         $Row.NumCpu = $item.Config.Hardware.NumCPU
         $Row.MemoryMB = $item.Config.Hardware.MemoryMB
         
         $createtime = $creationtimes | ? {$_.vm_name -match $item.Name} | Select-Object create_time
         if ( $createtime.create_time -eq $null ) {
              # for VMs that exists but db has pruned data, lump into single date
              $Row.CreationTime = [datetime]'12/01/2007 00:00:00 AM'
         } else {
              $Row.CreationTime = [datetime]$createtime.create_time
         }
         
         $myCol += $Row
         }
    
    $myCol = $myCol | Sort CreationTime
    

    This leaves me with a picture of the beautiful collection of dates, number of cpu and the size of the ram.

    I am stuck now trying this summary by calendar month - output something like:

    month,numcpu,memorymb,numOfVMs
    2009-10,2,8192,1
    2009-11,3,12228,2
    2009-12,1,4096,1
    

    In order ultimate spill in tables and graphics with ceilings determined at the time of the first

    I realize that there is probably a way to bind the SQL query method as well and pull it all together in a script. No idea how to transform the DataSet that is returned to a Collection of usable objects.

    Unless someone out there has a great way to draw growth VM distribution over time?

    The Group-Object cmdlet can take more than 1 property group

    Something like that

    $mReport = @()
    $groups = $myCol | Group-Object -Property {$_.Date.Year, $_.Date.Month}
    ...
    
  • Remove objects from the AD when a virtual machine is removed from the vCenter with vCO

    All,

    I am new to vCenter Orchestrator and have bad getting started with him.  I'm trying to figure out how to automatically remove the Active Directory from the computer object when it is deleted in vCenter.  My idea is when the virtual machine is removed, it starts a workflow that deletes the object.  I don't know how to call that or if it is still possible.

    The problem I am trying to solve, is that our developers are self provisioning of servers Windows and Linux through vCAC in the realm of 50 + per day.  They also remove most of them in 5 or 6 days causing much left on objects cluttering up AD.   So I try to find a way to have the deleted object when they destroy their vCAC provisioned machines.  My original idea was to make based on the GUID and UUID but I not figure out how to actually call with vRO.  I'm open to other ideas that can adapt to this task better, no need to force this idea of the solution to the problem if someone already knows a way to do that.

    Little background information is that I'm under vCenter 5.5 Update 2, 6.1 and vCO 5.5.2 vCAC.  The objects being deleted are Windows 2008 R2, Windows 2012 R2 and CentOS 6.5 servers.

    Thank you in advance, I think that once I get more of an idea on how it works, I'll be able to deploy more ideas.

    This can be achieved by simply adding following some custom properties in your Machine Blueprint or group of companies in VCAC.

    Plugin.AdMachineCleanup.UserName-

    Plugin.AdMachineCleanup.Password-

    Plugin.AdMachineCleanup.Execute

    Plugin.AdMachineCleanup.Delete

    Otherwise, create a profile to build using above set of custom properties, this way it will be easy for you to add in several plans in your environment vCAC.

  • Remove the NIC of the virtual machine running?

    Im trying to remove one NIC from a script and the machine has to be on. I am trying:

    Get-NetworkAdapter $vmname | where {$_.NetworkName - eq "Network 10"} | Remove-NIC

    Remove-NetworkAdapter: 2011-09-28 15:59:24 the VM Remove-network card must be in the following State: PoweredOff.
    At line: 1 char: 101
    + Get NetworkAdapter W7-AutoPrv003 | where {$_.NetworkName - eq "Network 10"} | Remove-NIC < < < <
    + CategoryInfo: InvalidOperation: (PoweredOn:PowerState) [Remove-NetworkAdapter], ViError
    + FullyQualifiedErrorId: Common_SharedParameterHelper_VerifyVmIsInState_VmNotInState, VMware.VimAutomation.ViCore.Cmdlets.Commands.RemoveNetworkAdapter

    Would I really thing that there is a way to remove the NETWORK card when the virtual machine is turned on?

    There with the ReconfigVM_Task method.

    $vm = Get-VM MyVM $nic = $vm.ExtensionData.Config.Hardware.Device | where {$_.DeviceInfo.Label -eq "Network adapter 2"}
    
    $spec = New-Object VMware.Vim.VirtualMachineConfigSpec $dev = New-Object VMware.Vim.VirtualDeviceConfigSpec $dev.operation = "remove" $dev.Device = $nic
    $spec.DeviceChange += $dev
    
     $vm.ExtensionData.ReconfigVM($spec)
    

    Don't know what the risk is, however.

  • Turn off the virtual machine to remove the snapshot?

    I discovered that, even though my Snapshot Manager says that there are no photos, I have several virtual machines with the snapshot files. I tried to create a new snapshot and then remove it, but it does not work. I tried to shut down the VM, and then create a snapshot and remove - that works. What is the difference? Why would it works when the virtual computer is disabled but does not work when the virtual machine is turned on?

    And even if you go to snapmgt you can not delete them?

    Download rvtools tool, there is an instant writer and see if there's trully snaps and might send a screnn for me!

  • Get use of the resources of all virtual machines in a cluster

    Hello

    I have developed a measure of capacity management report that collects all the use of the resources of the virtual machines in a datacenter. The function that collects it looks like this:

    def hostMemoryConsumed =]

    def memoryConsumed = 0.0f

    def memoryGranted = 0.0f

    VMs. each() {}

    VM->

    try {}

    memoryConsumed += vm.host.memory.consumed.current.average / 1024.0f<----- how="" to="" do="" this="" to="" get="" from="">

    memoryGranted += vm.host.memory.capacity.current.average / 1024.0f

    }

    {} catch (NullPointerException e)

    }

    VMS is a function of type parameter VMS VMW

    The works above for virtual machines in the data center, but I need it to be after cluster. I can find a cluster of virtual machines, but I'm having trouble with referring to specific values for example consumed memory and capacity.

    If I change the type parameter: VMW Cluster how the metric reference would look like (see the try {})?

    I don't think that a query will help me.

    Thanks in advance

    Erik Alm

    If you want to do for a cluster, you can just get the list of virtual machines in a cluster of first and passing in your script.  If you have a function for a VMWCluster you can add a parameter for "vmwCluster" that is underneath and it should give you a table (topologyObjects) that has all the virtual machines in the cluster.

    QS = server.get ("QueryService") / / query Service

    tquery = qs.createStatement("!) (' VMWVirtualMachine where esxServer.parent.name = "+" ' "+ vmwCluster +" "" ") .setQueryTopologyObjects (true);

    topologyObjects = qs.executeStatement (tquery) .getTopologyObjects)

  • Error! The CPU was displayed by the operating system of Fords. Power off or reset the virtual machine

    Why when I try install Mac Os Yosemite in VMwareplayer when the virtual machine starts, I get this error:

    The CPU was displayed by the operating system of Fords. Power off or reset the virtual machine

    I have an AMD A10 processor

    VMware does not support the operation of Mac OS X in VMware Player/workstation!  Also, legally virtualisables versions of OS X running in a Virtual Machine can be done when done in the Apple brand hardware but when done while running under OS X, and for that, you need VMware Fusion not VMware Player/Workstation (or use ESX/ESXi on Apple brand hardware) you violate Apple's SLA for this product.  So any help can you provided for OS X in this use of the scenarios that it would violate the community VMware operating conditions to do.

  • Activate the Virtual Machine start and stop

    Hello

    I'm not activate Virtual Machine Startup and shutdown I don't know what is right.

    Untitled.png

    Hello

    This is the VMware KB which provide a workaround to enable this option for VMs on ESXi hosts in cluster HA active.

    VMware KB: Automatic Virtual Machine Startup / Shutdown in ESXi hosts in a cluster VSA is turned off

    Last time (couple of years back), when I was researching on this topic, I found that these settings are applied only when the virtual machine is on the same host ESXi, and once his migrated to another ESXi host for this VM autostart option is lost and needs to be reconfigured again. I don't know if this behavior changed with new versions of vSphere.

    I hope this helps.

    Arun-

    Twitter: https://twitter.com/arunpande

    Blog: http://highoncloud.blogspot.in/

    Virtualization VMware on NetApp

  • Is reset or restart the virtual machine should all expanding vmdk size?

    Hi all

    While extending the size of 20 to 28 GB GB vmdk I can extend when the VM is in poweron State, but he didn't think inside the virtual machine. The disc is resized when the virtual machine won reset or reboot.  I would like to know if the reset or restart that virtual computer is must have for resizing vmdk. If it is then what is the use of expansion of disk while the VM is in poweron State?

    Thank you

    Vijaya

    Yes with windows 2008, you can extend the OS disk to create a new drive letter instead.

    Here is a tutorial: http://www.petri.co.il/extend-disk-partition-vista-windows-server-2008.htm

  • Shortcut to the Application on the virtual machine

    Hello

    I wonder if it is possible to have shortcuts on my dock that points to an application installed on a Windows 7 VM?

    When the user clicks the shortcut, VMWare Fusion is open, the Windows 7 VM boot and application loading?

    If so, what would be the shortcut text?

    Thanks in advance.

    When you run an application when the Virtual Machine is for unity a Dock tile for the app shows on the dock and you can ctrl-click it and select Options > keep in the Dock and use it to open this app if the Virtual Machine is running or not.  Of course after that, if the Virtual Machine does not work it will be started and then the application open.

  • If the virtual machine is restarted during SVmotion...?

    Hello

    During the SVmotion if I try the scenarios below would be the SVmotion fail or still work?

    Say if I trigger a SVmotion when the virtual machine is powered off and then during the migration, if I try to turn on the virtual machine what?

    If I trigger a SVmotion on a virtual machine under tension and during the migration, if I restart the virtual machine what will happen?

    Deepak

    Storage VMotion is process for powered on VM - it's migration transparent disk online. So if you want to restart the computer during Storage VMotion virtual it will be restarted. SVMotion care VM do inside.

    But when you migrate powered off the computer virtual you just will not be able to turn on.

    ---

    VCP MCSA, MCTS Hyper-V, VMware vExpert 2009, 3/4

    http://blog.vadmin.ru

Maybe you are looking for