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

Tags: VMware

Similar Questions

  • Allocation of resources to the virtual computer

    Hello

    I wonder if anyone can shed some light on what follows.

    When I create a new virtual machine and go the tab of the allocation of resources.  There are two different areas of the reservation.  One that we can configure other seems to be the maintained system.

    When the system is off the reserve which is managed by the system is listed as 126MB.  Once the system is powered on it goes down to about 90 MB and then slowly climbs back up to 126 MB.

    Can someone explain this.

    Thank you
    Mamadou Moustapha

    I assume you mean the memory overhead.

    Take a look at the memory overhead on the Virtual Machines in the documentation.

    If this isn't what you asked, please attach a screenshot of what you are looking for.

    André

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

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

  • VMWare Fusion makes a break from the virtual machine because the disk is almost full.

    Is I myself am sitting at my computer this morning, I saw a message that says the guest system Windows XP Pro on my Mac Mini has been suspended.  Here is the message:

    "VMware Fusion has suspended this virtual machine because the disk on which the virtual machine is stored is almost full."

    I can't find a way to shut down Windows to resize hard disk space allocation.  I tried the Virtual Machine menu, but all the shut down/put off the power points are grayed out.

    Any ideas out there?

    You must read the message!

    BTW if force you the VM to the bottom you may corrupt the virtual system hard disk and or the VHD file and you need to just do as the message says and free up space on the OS X hard disk even if you temporarily move a few things on an external hard drive so that you can then reactivate the Virtual Machine and continue on the it.

  • Operating system of the virtual machine attempted to activate the adapter Ethernet0 promiscuous mode. This is not allowed for security reasons.

    Hi all

    When I start my vm I get error

    "Operating system of the virtual machine attempted to activate the adapter Ethernet0 promiscuous mode. This is not allowed for security reasons. »

    I have been to this page http://KB.VMware.com/selfservice/microsites/search.do?language=en_US & cmd = displayKC & externalId = 287

    From this page, on my webhost, I created a group called "vmware-vmnet0", then I add the user running vmware to this group.  I can give this rw on/dev/vmnet0 group permissions

    However, I still get the same error above on starting the virtual machine each time.  How can I solve this terrible problem.

    Thank you.

    Device nodes are re-created at boot time.  You can thank Linux udev.  To work around this problem, create the vmnet devices * with the ownership and the permissions you want under/lib/udev/devices.

  • Limitation of the Virtual Machine's CPU/memory resources.

    Hello

    My question on the tab "resources" with VMachine settings (I hope I picked the right branch here)

    In this tab I put a booking/Limit for CPU/memory for current VMachine.

    I have a cluster about 6 ESX servers with resource by default and a VMachine inside pool. VMachine have 1 CPU. Each ESX have 2 plugs with 4 core per socket. Each base equal to 2, 83GHz. Def.

    In this case, which by default configuration for an average CPU for this VMachine limitaion - 132582 MHz? Because in practice ESX server can give only 1 CPU for this VMachine and this CPU will have 2, 83GHz only...

    Also, I put 100% of CPU - 132582 MHz booking here... But in true VMachine will never receive this resource...

    Same question about limitation of memory...

    When this limitation will work? For what porpose such booking/limitaion here?

    Re: But, if I'm going to make a mistake and this CPU for VM value reserve, which is more physical limitation - it reduces resources processor for other VMs on a value that is more than the physical limitation of the virtual computer?

    No, the reservation only guarantees that if a virtual machine wants to take a large part of the resource at a given time VMware should give him.  If there is ever going to be a situation where the virtual machine is in fact to consider that much so it never gets allocated to this virtual machine and the amount of the resource remains available for other virtual machines to use.  Similarly, if the virtual machine just does not use the amount of the booking to a point in time, he let this resource can be used by other virtual machines.

    If a virtual computer uses only 1 GHz on a core 3 GHz system, at a given time but thereservation is 2.5 GHz, 1.5 GHz between its use and booking that is not used at this time is available for other VMS to use.  That is only if there is a period of contention between VM and VM CPU wishing to use mean 2.8 GHz it would be guaranteed to get 2.5 GHz independently of the parameters of the actions on the VM from other virtual machines.

    It is essentially the same thing with memory except that the memory usage is not as CPU flunctuate and VMware must also use more complex methods to reallocate the memory, but the leaders of the way in which it is shared using actions, reservations and limit is the same.

  • Cpu for vm resource stocks are much lower than the virtual machine in the list of resources

    I move a virtual machine from a PR, but I got this warning

    Capture.PNG

    I checked and there was no reserve on the virtual machine and the destination THAT RP is set to Unlimited and expandable reservation

    any idea?

    See: VMware KB: the movement of virtual machines between resource pools triggered the warning: percentage of Incorrect CPU

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

  • Guest member - % in the tab of the virtual machine is meaningless?

    HI - so I haven't read hot air balloon, shared, private and everthing on the vmware RAM allocation.

    However I still do not get the 'mem % comments' column in the tab of the virtual machine for a given cluster.

    For example, I have a machine that shows:

    -in windows Task Manager, total physical: 4 GB, available: 1 GB. Incur costs: 7 GB

    -in the "allocation of resources" tab vmware: private: 3.9 GB, ball 0, 5 MB compress, shared 95 MB. Consumption: 4 GB.

    BUT in the tab of the virtual machine to the host, I see: host mem 4 GB (ok) and guest mem %: 18%

    IT makes no sense as a guest mem % is supposed to represent the percent of GUEST memory usage - which in this case should be 75% or 100% depending on how you look at it, but certainly not 18 percent.

    As I understood the mem % calculated using something comments are called "active memory". Active memory is memory that has been actively used "currently" (I don't know what "currently" means in time quantified tho). What you see inside windows, in the Task Manager, is allocated in memory from the point of view of windows, but windows is seen only (depending on the setting of mem comments) using 18% of 4 GB or 720 MB. A nice information to have if you plan to make a reservation for this virtual machine and that you really want to know what to set the reserve at since the rest of the memory could be balooned (toggled) without any noticeable decrease in performance of the virtual machine.

    / R

  • Could not power on VM: no space is available on the device: cannot power on the virtual machine.

    VMware esx ei, 3.5.0 123629

    Physical memory: 64 GB

    Hard drive: 1.63 TB

    7 virtual machines. 5 of them are configured with 4 GB memory and 2 of them with 2 GB of memory. I am able to power on 3 virtual machines with 4 GB of memory.

    When I try to turn on 4th VM with 2 GB of memory, I get this error message "could not power on VM: no space is available on the device: cannot power on VM.»

    I would like to know if this is the limitation of the ESX Server? How should I size the memory for VMS if I want to run every 7 virtual machines to the

    Moreover, given that I have 64 GB of physical memory. Is there documentation that provides a report of the maximum allowed memory configurable

    compared to the virtual memory?

    Thank you

    Ganesh.

    Ganesh,

    Memory reservations are defined based on VM by VM.

    You can allocate more memory to the virtual machines you have in your host (it's not really a good idea to go crazy with the overcommitment of memory, but some level of excessive pressure is used in general).  Memory applied to your VM resources are shares, bookings and VMkernel Swap limits.

    Just to illustrate:

    You allocate 8 GB memory to a virtual computer.  If you take all the parameters by default, ESX will allot a 8 GB VMkernel Swap file in the base directory of your VM (it will have the extension ".vswp") this VMkernel Swap file is a safety net.  Your virtual machine, at this stage, can consume up to 8 GB of memory If physics is available from the host.  If the memory of your host is overcommitted, some of the available memory 8 GB could be allocated on 8 GB VMkernel Swap file.

    If you set a reserve of memory - 2 GB - this means that the vmkernel will still award the first 2 GB of memory used by the virtual machine to the physical memory.  This is not means that the 2 GB of memory reserved is carved off the coast and completely dedicated to the virtual machine.  This means that the vmkernel offers up to 2 GB of RAM to the VM when and if she needs to use it.  It is a guarantee that the memory will be available upon request.  Because of this guarantee of the VMkernel, VMkernel swap file only has to make sure that the 6 GB memory is satisfied (4 GB total less the 2 GB reserved), so the VMkernel Swap file is only 6 GB in size.

    Actions are a mechanism for prioritization and limits are a cap on physical memory ever allocated to the VM.

    You can set up any number of memory for the virtual machines that you want - frankly, overcommitment of memory for ESX is a very good thing, but you must be vigilant about watching your systems if approve you.  If you have 64 GB of RAM, and you only configure your virtual machines to use total 32G, then you lose 32 GB of RAM.  If you allocate, say, 96 GB of RAM (total) to your virtual machines, then you look at a 50% overcommitment.  What to watch in overcommitting memory is application performance (and more importantly - perception of the user of this performance) and also the memory ballooning and VMkernel Swapping activity.  Those who can both will be in graphics performance in VirtualCenter.  I would recommend reading the Guide to management resources for more details.

    Hope that provides an overview.

    Thank you

    -jk

  • Use of the virtual machine / machine is safe?

    I have windows 8.1 pro I want to use operating systems diferrent/test I use virtual box to install the OS on my laptop, it will be useful for me to install os without data lost, but I noticed that when I run the VM my system's struggle

    can I use the virtual machine on my laptop without care or stop using it please help

    Hello

    It is very good for the material.

    But follow the steps above, then you don't take too much of your main operating system resources when you install virtualbox.

    Checkurtech

  • If the virtual machine can be harmful?

    VPC may be dangerous for my pc anyway. I have average can do something wrong?

    A virtual pc will create a virtual environment within its program. It runs as a program in your computer and request data to be processed by your processor. Depending on the type of virtual software you use, most of the time things happening inside the virtual machine will not in any way to communicate with your computer. To use the resources he will communicate the virtual pc program and then the program will ask you to windows resources.

    Therefore, the virtual pc will be not harmful. It will use the same amount of resources (CPU, memory), such that a normal computer would be nice. I advise to use windows xp.

    -Alex

  • I've set up the virtual machine in win 7 Ultimate and put some data. Now when I try to connect it asks password and does not accept any password.

    Default password Machine virtual XP Mode

    I've set up the virtual machine in win 7 Ultimate and put some data. Now when I try to connect it asks password and does not accept any password. Please giveme the default password

    If you're talking about XP Mode the default password is XPMUser.  In general you can not use Windows without a password in Windows Virtual PC that you can with Virtual PC 2007 and before.  XPMUser is used only with the XP Mode virtual machine.  All other virtual machines requires a user created password.  If you have changed the password in XP Mode and forgotten, then you have to start over.

    Windows Virtual PC is based on virtual server rather than VPC and all virtual machines need a password.  If necessary, uninstall the integration features, start the virtual machine and create a password for the admin user.  Restart the virtual machine, and then reinstall the integration features.  You will not be able to access a virtual machine created by the user that has no password, while the integration features are installed.  Once you have everything right, that a virtual machine will not be asked a password if you are the admin user in Windows 7.

    @george1009,.

    Everything got?  :)

  • First construction of DEFAULT DOMAIN for "Integrated Weblogic Server" in jDeveloper 12 c gave ERROR: wlst &gt; error occurred during initialization of the virtual machine;

    Hi my community developers estimated!

    I just installed Oracle jDeveloper 12 c as part of the new version BPM Suite 12 c successfully on my LAPTOP.

    However, when I try to create the first integrated default for the weblogic Server domain to run by using the database of embedded JAVA (do NOT use an external Oracle DB) - I get the following error in the log below:

    QUESTION - how/where can I change the ' USER_MEM_ARGS = - Xms32m -Xmx1024m' specification in jDeveloper, to allow a smaller 'MAX MEMORY setting, instead of Xmx1024m"since I DO NOT have enough memory (virtual) on my laptop to create the default domain.

    Thank you very much!

    Please see from the log of the errors below:

    Add the environment variable to WLST script = - Xms32m USER_MEM_ARGS - Xmx1024m - XX: MaxPermSize = 384 m
    Log file: D:\data\859442303\Application Data\JDeveloper\system12.1.3.0.41.140521.1008\o.j2ee.adrs\BuildDefaultDomain.log
    Label: JDEVADF_12.1.3.0.0_GENERIC_140521.1008.S
    Home product: C:\Oracle\Middleware\Oracle_Home\jdeveloper\jdev\
    Area: D:\data\859442303\Application Data\JDeveloper\system12.1.3.0.41.140521.1008\DefaultDomain

    2014 BuildDefaultDomain2.py - 07-04 18:00:03

    cmd.exe /c "" C:\Oracle\Middleware\Oracle_Home\oracle_common\common\bin\wlst.cmd""D:\data\859442303\Application Data\JDeveloper\system12.1.3.0.41.140521.1008\o.j2ee.adrs\BuildDefaultDomain2.py""
    Process began
    WLST > error occurred during initialization of VM
    WLST > could not reserve enough space for lots of things
    WLST > error: could not create the Virtual Machine Java.
    WLST > error: a fatal error has occurred. Program ends.
    Elapsed time: 437 ms

    Thanks James, I changed the memory allocation in the WLST script and I no longer get the VM error

Maybe you are looking for