Posts

Showing posts from November, 2017

Importan windows CMD

System uptime systeminfo | find "Boot Time "

Snapshot using powercli multiple VM

Snapshot using powercli multiple VM Connect -viserver "vcenter" enter the password Create the text file snap.txt and copy the all server name on the file go to the txt file location snap.txt $snap = get-content snap.txt run the following cmd get-vm -location “snap” | New-Snapshot -Memory -Quiesce -Name PrePatch

Template registration using powerCLI on multiple vcenter

1. connect-viserver vcenter2-tsg1.mhint New-Template -Name rhel62-x86_64-vanilla-1.0.2 -TemplateFilePath "[vmtemplates] rhel62-x86_64-vanilla-1.0.2/rhel62-x86_64-vanilla-1.0.2.vmtx" -Location ( Get-Folder -Name Templates ) -VMHost mgmt-tsg1-esxi01.mhint New-Template -Name rhel64-x86_64-vanilla-1.0.2 -TemplateFilePath "[vmtemplates] rhel64-x86_64-vanilla-1.0.2/rhel64-x86_64-vanilla-1.0.2.vmtx" -Location ( Get-Folder -Name Templates ) -VMHost mgmt-tsg1-esxi01.mhint New-Template -Name rhel65-x86_64-vanilla-1.0.2 -TemplateFilePath "[vmtemplates] rhel65-x86_64-vanilla-1.0.2/rhel65-x86_64-vanilla-1.0.2.vmtx" -Location ( Get-Folder -Name Templates ) -VMHost mgmt-tsg1-esxi01.mhint disconnect-viserver -confirm:$false 2.  $cluster = Get-Content .\vcsa.txt 3. Disconnect-VIServer * -Confirm:$false 4. Connect-VIServer $cluster 5. Get-Template  rhel62-x86_64-vanilla-1.0.2 | ft Name,@{N="vCenter";E={$_.ExtensionData.CLient.ServiceUrl.Split('/...

Powering On and Off multiple Virtual Machines Using PowerCLI

Powering On multiple Virtual Machines Using PowerCLI 1.Enter the all vm list to servers.txt file and save to c:\scripts folder 2. $servers= Get-Content c:\scripts\servers.txt, 3.Run "$servers" cmd to check servers list 4. connect vcenter following cmd Connect-VIServer -Server $VIServer -User $Username -Password $Password 5. To run the following cmd to start the VM's Start-VM -VM $servers -RunAsync Disconnect-VIServer $VIServer -Confirm:$false Powering Off multiple Virtual Machines Using PowerCLI 1.Enter the all vm list to servers.txt file and save to c:\scripts folder 2. $servers= Get-Content c:\scripts\servers.txt, 3.Run "$servers" cmd to check servers list 4. connect vcenter following cmd Connect-VIServer -Server $VIServer -User $Username -Password $Password 5. To run the following cmd to start the VM's Get-vm $servers | Shutdown-VMGuest Disconnect-VIServer $VIServer -Confirm:$false

Using Non-Maskable Interrupt (NMI) facilities to troubleshoot unresponsive VMware Virtual Machine.

Using Non-Maskable Interrupt (NMI) facilities to troubleshoot unresponsive VMware Virtual Machine. 1, Need to identify the ESXi host name, Where the hung VM running. 2, Login to ESXi server using Putty and run ‘vmdumper –l’ for find world id(wid) of the hung VM 3, Run ‘vmdumper <wid> nmi. 4, After send NMI signal, we can see dump creation in the VM console. 5. Export the System log on particular VM,

Generating Full,kernel dump from VMware Virtual Machines

Image
Generating Full,kernel dump from VMware Virtual Machines Lately we started to see lot of VM's going down and when we reach out to VMware they analyze and as usual asking us to go to Microsoft other than VMware issue. Lot of the Virtual machines when they hung manual hard reboot is required.During the hung if you try to use keyboard to generate dump so far i was never successful and end up hard reboot the Server with no dump . So for all these problems now we have tool call VMSS2CORE, this tool is internally used by VMware, now its available for download, click here  Well wondering what this tool will do for you, if you go over link it explains in brief for starters .. lets assume  VM is hung so during the outage take a snapshot of the VM  and then reboot the VM. After you took the snapshot go and browse datastore for the snapshot file and you will see a file with .vmsn as below.. download the .vmsn file and place it in the same directory where you dow...

Map drive CMD.

Map drive CMD.  -   net use Q: \\Phxfss01\BMHD /persistent:yes

ROBOCOPY command

ROBOCOPY source distination /e /copyall /secfix /mir /xa:h /r:10 /w:10  /LOG:D:\ROBO2.TXT robocopy c:234 /SEC /COPYALL /XO /X /E /MIR /ZB /R:1 /W:0 /LOG:E:\logfilename.log ROBOCOPY D:\TEST1 E:\TEST1 /E /ZB /COPYALL /SEC /MIR /XO /X /R:10 /W:10 /LOG:E:\ROBO.TXT

Remove multiple snapshot through PowerCLI command

  Remove multiple snapshot through PowerCLI command     connect-viserver -server vcenter name -user xxxx   -password xxxx    output :    Name                           Port  User    vcenter name              443   domain\username    Run the following cmd to delete the Snapshot    Get-VM    get-vm $corpser | Get-Snapshot | select vm,name,description,created,sizegb | Form     at-Table,    $corpser - having list of VM's    Showing list of snapshot   Get-VM | Get-Snapshot    Showing list of snapshot    Get-VM  | Get-Snapshot | Remove-Snapshot -Confirm:$false    It will show deleting snapshot ..

Add & Remove -datastore through Power CLI

Add  & Remove -datastore through Power CLI connect-viserver -server vcenter name -user xxxx   -password xxxx get-vmhost -location $cluster | new-datastore -Name Datastore -Path $remotePath -NfsHost $remoteHost Get-VMHost -Location $cluster | Remove-Datastore xxxxxxxxxxx -Confirm:$false Name                           Port  User vcenter name              443   domain\username PowerCLI C:\> $cluster = get-cluster -name cluster name start with* PowerCLI C:\> Get-VMHost -Location $cluster | Remove-xxxxxxxxxxxx -Confirm:$false

SnapDrive for Windows - Drive Letter to LUN Mapping Config File

SnapDrive for Windows - Drive Letter to LUN Mapping Config File view  SnapDrive doesn't maintain a text file or database containing the information you want.  Rather, if connects to the storage one demand and generates this data as needed comparing the current Windows LUN mounts to the current locations of the LUNs on storage.  Given you can move a LUN transparently at current levels of Data OnTap, the disk information needs to be dynamic.  You can list the current disk mapping and underlying detail easily to a text file using the SnapDrive CLI.  > sdcli disk list  for example and you could periodically run that and save it off to a text file for reference.  You may have to preface the command with path information depending on your Windows PATH variable setting:  > "C:\Program Files\NetApp\SnapDrive\sdcli" disk list  assuming all default locations.  The SnapDrive command line is highly useful for automating co...

MS boot MGR missing issue

Bootmgr was missing. Booted in WinPE and started startrep.exe from X:/sources/recovery. The server repaired up files and rebooted the server but no help. Booted again in WinPE mode. Checked and found that bcd file was corrupt. Rebuild boot files. Checked the active partition using diskpart and found that the active partition was not system reserved. Marked active partition as System reserved which was F drive. Rebuild the boot files using C:\windows\System32\config>bcdboot C:\Windows /s F: Checked with bcdedit if the bcdedit was pointing correctly. Rebooted the server , but the server got 7B error. Booted the server in safe mode but no help. Booted the server in last know good configuration but no help. Changed the controller type to paravirtual as the server was initially configured. Booted the server again. Server booted up fine and came to login prompt.

Remote windows server RDP access issue

Image
Remote windows server RDP access issue Error 1.solution.. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters Make sure Type = NT5DS Run these commands: w32tm /query /status   check is the source server same for both working and non-working servers and what is the time difference try this: keep running this command for over a period to see how time drift w32tm /stripchart /computer:Dc name  /samples:4 /dataonly try this : to see if it resolves if it runs on own process w32tm /unregister w32tm /register sc config w32time type= own net start w32time w32tm /resync Final option: To enable Windows Time service debug logging, at the command prompt, type the following command, and then press ENTER: w32tm /debug /enable /file:c:\W32Time\w32time.log /size:10000000 /entries:0-116 2. Run the virus scan. 3 .Check the computer object in Ad and verify its in correct container. 4. Unjoin and rejoin it from domain.

vcenter 6.5 configuration

Image
Synopsis This page describes the base installation procedure of new vCenter with embedded database. In the second part of the document is described the replacement procedure from exist production vCenter 5.5u3d Install procedure Create the new DNS records and reserve the IPs in IPAM. Create alias for "vcenter2" mkafadarov @fgprd -platform-services-app001:~$ infoblox-host-add -n fgtd-vcenter2-nte1-app001.mhint -i  10.0 . 203.102   --aliases vcenter2-nte1.mhint Download installation media -  https://download2.vmware.com/software/vc/65/vsan66/VMware-VCSA-all-6.5.0-5318154.iso  (version  6.5d) Mount the ISO file in Virtual CD or use 7zip or other software to get VMware-vCenter-Server-Appliance-6.5.0.5500-5318154_OVF10.ova file from "vcsa" directory; Deploy new vcenter vm/appliance from  .ova file using exist vCenter in  MGMT cluster ; From vCenter File→ Deploy OVF Templete → Select .ova file; Verify  VMware vCen...

connect vcenter from powercli and genrate the report

1. C:\Users\username\Desktop> $vCenters=Get-Content ruh1.txt 2. Connect-VIServer -Server $vCenters -Username xxxxxx -Password xxxxxxx 3. C:\Users\username \Desktop> Get-VM | select Name, Description, PowerState, NumCpu, MemoryGB | Export-Csv report.csv