Angels Technology

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Friday, June 29, 2012

Shutdown all vms on a vsphere instance

Posted on 11:38 PM by Unknown

    This post http://communities.vmware.com/message/2068218#2068218 got me thinking about various DR situations.
    Essentially, what the op was saying was that even though he has a generator, it doenst work. Another variable that can throw wrenches in someones day.

    Not going into reasons why someone doesn’t have other DR plans, sometimes a graceful shutdown is much more efficient then a looming hard shutdown.

    Using the script from herseyc I'm going to run it on my infrastructure as a demo.

    # Get All the ESX Hosts
    $ESXSRV = Get-VMHost
    # For each of the powered on VMs with running VM Tools
    Foreach ($VM in ($ESXSRV | Get-VM | Where {$_.PowerState -eq "poweredOn" -and $_.Guest.State -eq "Running"})){
        # Shutdown Guest
        write-host "Shutting down $VM"
        $VM | Shutdown-VMGuest -Confirm:$false
    }

    Pasted from <http://communities.vmware.com/message/2068218#2068218>

    You will need powercli already installed.



    Here is my powered on vms list

    Lets see what happens when we run the script







    As we can see the script initiated a shutdown on all the running guests on the  vsphere instance.
    Looking at the task bar of the client for vsphere you can see guests going down.


     Even my vcenter went down, as planned



    What is this? We have a server still running! I am connete  to the host here.




    Looking at the summary, you can see vmware tools is not installed.
    So a shutdown command wouldn’t be well received.
    If the vmware tools is not installed or has an issue and isn't running then the server will still be running and you wouldn’t know it if your vcenter is virtualized.


    Possible solution can be a script that runs on the vcenter server that stops the vmware tools service! Run this first and then run the shutdown command so your vcenter is the last to go.
Read More
Posted in command line, powercli, vm, vmware, vsphere | No comments

Power off Virtual machines via command line: Part2 : force off vms

Posted on 10:43 AM by Unknown

    Previously I wrote about powering off vms with vim-cmd vmsvc/power.off  VMID

    Now suppose even with a hard power off command, the vm wont go down.
    You can kill the process associated with the vm.


    I had to do this on one of my hosts a while ago when it locked up.


  1. The first thing you will need is the process id of the host you want to terminate.
  2. Host I want to terminate: esx_esx1
  3. Run this command ::  ps | grep vmx



  4. Here you can see : the vmx associated with esx_esx1has a PID of 629720
    The left number is the PID of the thread, and the right number is the PID of the parent process.
    The  line : 3703775 629720 vmx-mks:esx_esx1     /bin/vmx      shows the parent is 629720.

    Make sure you have the right pid!

    Now we are going to terminate the vmx process
    Before that we check to see what the power state of the vm is. See this if you want to know more about the VMID



    Now enter :  kill PID    which in this case is kill 629720


    The vm is powered off now after terminating the parent vmx




Read More
Posted in command line, esxi, ssh, vm, vmware | No comments

Vmware reference card.

Posted on 8:34 AM by Unknown
Just found this vmware reference card over at http://www.vreference.com/
Looks like it has all the "should know" information, which can help not only on a day to day basis, but also makes for a great reference tool for VCP studying.

I didnt host a copy since it may be updated and it's better to check back at the site.

Read More
Posted in vcp, vmware | No comments

Power off Virtual machines via command line

Posted on 1:29 AM by Unknown
     Here are the steps to power down a vm via ssh or tech support mode.
    The reason this could be useful is if you are having problems with your management agents and before a reboot of the host you wanted to shutdown the vms

    Connect to the host in question. Im using ssh. Make sure you enabled it.


    First list all your vms on the host::      vim-cmd vmsvc/getallvms
    This will list every vm.



    It will list:
  1. Vmid   : virutal machine id
  2.  Name : of the server in vsphere
  3.  File :: which is the location and name of the VMX,
  4. Guest OS ::  os type
  5. Version :: of hardware     


  6. Example:
    For 250-DC01
  7. Vmid   : is 7
  8.  Name : is 250-DC01.
  9.  File :: located in datastore2 under 250-DC01
  10. Guest OS ::  win 2008 64 is listed as windows7server64guest
  11. Version :: of hardware    is 8


  12. The VMID is the key to the following steps.
    To get the power state of 250-DC01 we would enter

    vim-cmd vmsvc/power.getstate VMID

    Which in this case is

    vim-cmd vmsvc/power.getstate 7







    To gracefully to a shutdown, enter

    vim-cmd vmsvc/power.shutdown VMID

     which in this case is

    vim-cmd vmsvc/power.shutdown 7




    If you run the power.getstate again you will see its off now.



    If you have a vm where it either will not shutdown or you don’t have vmware tools installed, you will need to use another command.
    vim-cmd vmsvc/power.off VMID



     As you can see above, the VM with vmid 43 didn’t have vmwaretools so I was not able to send it a shutdown request.
    So I had to hard power down the vm.


    My suggestion, shutdown first, hard power down if you have to.




Read More
Posted in command line, esxi, ssh, vm, vmware | No comments

Thursday, June 28, 2012

Veeam one now has a free edition! Also try Veeam backup free if you haven't

Posted on 11:55 PM by Unknown
We use veeam for our systems but it is nice to know that veeam is also putting a free version out there get users introduced to their software.



"There are no limits on the number of hosts, management servers or Failover Clusters you can manage, or the number of users or size of your data archive."
That pretty generous!


By simply installing a purchased license key, Veeam ONE Free Edition can easily be upgraded to the full version of Veeam ONE to gain these and other additional capabilities:
•Custom alarms and alarm modeling
•Full email notification for alarms
•Guest process monitoring and management
•All pre-defined reporting dashboards
•Automated report generation and distribution


This is from Veeam ONE: Free vs Full
 

while you are at it check out Veeam backup free edition, you will probably end uyp getting the paid edition since scedualing jobs and deduplication and incremental aren't included in the free version.


Find out more here http://www.veeam.com/virtual-machine-backup-solution-free.html?ad=homepage_block
Read More
Posted in backup, veeam, vmware, vsphere | No comments

ESXi host: viewing logs

Posted on 11:36 PM by Unknown

Using a Web Browser
I found this on techhead.co.ukbut I will include the steps here to keep everything in one place.
  • Open your favorite Web Browser
  • Enter the following: https://<esxi ip address>/host
  • Enter the ESXi Host Root username/password

Pasted from <http://www.simonlong.co.uk/blog/2010/06/03/vmware-esxi-4-log-files/>


This makes looking at the logs a lot simpler, for me.
View the logs is a pain, this makes for viewing them quicker if you have the address of your esxi host bookmarked.
Read More
Posted in esxi, logs, vmware | No comments

snapshots, which order to delete

Posted on 11:31 PM by Unknown

    So you have several iterations of snapshots under each other.
    And you want to only keep the current version.
    What to do?







    As you can see veeam didn’t remove the snapshot like it should have and now we have several change disks.
    So we have Parent disk, snap1, snap2, snap3, and current snap



    DELETE ALL: is a nono
    According to yellow bricks, http://www.yellow-bricks.com/2008/01/07/delete-all-snapshots/, you DON’T want to hit the "delete all".
    Why?
    " Snapshot 3 is merged into Snapshot 2, Snapshot 2 is merged into Snapshot 1, Snapshot 1 is merged into the original flat.vmdk and afterwards all snapshot files are deleted." Pasted from <http://www.yellow-bricks.com/2008/01/07/delete-all-snapshots/> "

    Meaning: : if you do delete all,
    current snap is merged into snap3,
    current +snap3 is merged in snap2, and
    current +snap3 +snap2 I merged into parent.
    But
    Untill all is merged nothing is deleted.
    So
    disk  space needed because very high.

    tips
    "Oinkmaster is right, the nicer way to remove several snapshots is to remove the nearest to the Base Disk repeatedly. This doesn’t require additional space."
    Pasted from <http://www.yellow-bricks.com/2008/01/07/delete-all-snapshots/>



    So how do we do this?
    Delete snap3, then snap2, then snap1 and we should be good.





Read More
Posted in snapshots, vmware | No comments

Troubleshooting: Vmotion: error migrating

Posted on 11:26 PM by Unknown

vMotion error: Virtual machine must be running in order to be migrated







Machine is powered on!





Vmware tools are running, I even restarted them







Restart services via DCUI or services.sh restart in ssh shell




Now I can migrate.






Read More
Posted in vmotion, vmware | No comments

Datastore: marked inactive but still accessible

Posted on 11:16 PM by Unknown

Datastore marked inactive in vpshere client.



Right click and browse datastore to see if we can access it.






Datastore appears as well as folders and items..



Restarting maangement agents










Storage now looks normal.






References: http://communities.vmware.com/message/1664857
Read More
Posted in datastore, vmware | No comments
Newer Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • Copy and paste clipboard items to and from your vsphere virtual machines and your pc
    Wanted to copy and paste text between your pc and a vm? Now you can. Power off your VM. Go to the vm properties->Options->Advanced-...
  • Interesting look at Win cpu usage vs Vmware CPU usage
    I came across this scenario: The windows task manager shows the cpu of the vm pegged at 100%. The vmware performance monitor says that ...
  • Storage comparison
    One of Cormac Hogan s posts provides a good basis for compares of different storage types for vmware Vsphere and how they stack up. He dis...
  • E1000 vs e1000e in vmware : notes
    Performance difference " The performance should be about the same, the reason for the change is that Intel is not longer supporting the...
  • vCenter and Hosts Disconnected -- Reason: Cannot verify the SSL thumbprint
    Just saw this over on the forums, but if your hosts are getting this error: Cannot syncronize the host <hostname.fqdn>, Reason: Cannot...
  • Vmware esxi : Intel Pro/1000 ET quad port adapter and ISCSI
    I've seen issues pop up with intel quad ports here and there on the forums so I thought it would be good to note down what worked here...
  • Vmware DRS anti affinity rules wont let you enter maintenance mode for a esxi host
    You have a DRS rule that specifies that 2 vms need to be kept apart: In this case: 250-FT and 250sql3 For larger clusters with multiple...
  • Snapshot creation /reversion/ deletion/ listing with vim-cmd
    Here we are going to use the command line on a esxi host to create, revert, and delete snapshots. First ssh into your host. Important thi...
  • shutdown your esxi host using powercli
    if you want to shutdown a host using powercli: Set-VMhost -VMhost HOSTNAME -State Maintenance get-vmhost HOSTNAME | Foreach {Get-View $_.ID}...
  • Setting your esxi host to restart automatically after crash or purple screen aka psod
    The default and recommended setting is to leave the purple screen of death up to help you notice that het host has died and also leave t...

Categories

  • 5.1
  • backup
  • cloud
  • cluster
  • command line
  • console
  • converter
  • cpu
  • datacenter
  • datastore
  • datastore. rdm
  • DCUI
  • dell
  • disaster recovery
  • display
  • DR
  • e1000
  • e1000e
  • ec2
  • esx
  • esxi
  • esxtop
  • extent
  • Good for enterprise
  • HA
  • hcl
  • host
  • HP
  • ibm
  • iometer
  • iscsi
  • iso
  • linked mode
  • logs
  • MAC
  • memory
  • NFS
  • NIC
  • NTP
  • ova
  • ovf
  • p2v
  • pcie
  • performance
  • phone
  • powercli
  • powershell
  • PSOD
  • raid
  • RDM
  • resource pool
  • rvtools
  • scsi
  • sddc
  • snapshots
  • SQL
  • SRM
  • ssh
  • storage
  • svmotion
  • syslog collector
  • v2v
  • vapp
  • vcenter
  • vcloud
  • vcp
  • veeam
  • VI console
  • vm
  • vmdk
  • VMFS
  • vmkfstools
  • vmotion
  • VMUG
  • vmware
  • vmware tools
  • vmware.esxi
  • vmxnet3
  • vsphere
  • vum
  • web client
  • windows

Blog Archive

  • ►  2013 (28)
    • ►  October (2)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (14)
    • ►  May (1)
    • ►  April (1)
    • ►  March (5)
    • ►  February (1)
    • ►  January (1)
  • ▼  2012 (138)
    • ►  December (2)
    • ►  November (13)
    • ►  October (26)
    • ►  September (19)
    • ►  August (35)
    • ►  July (34)
    • ▼  June (9)
      • Shutdown all vms on a vsphere instance
      • Power off Virtual machines via command line: Part2...
      • Vmware reference card.
      • Power off Virtual machines via command line
      • Veeam one now has a free edition! Also try Veeam b...
      • ESXi host: viewing logs
      • snapshots, which order to delete
      • Troubleshooting: Vmotion: error migrating
      • Datastore: marked inactive but still accessible
Powered by Blogger.

About Me

Unknown
View my complete profile