Thursday, 28 July 2016


(1)How to increase the time limit on snapshot consolidation (2146270) 

Purpose

You can increase the maximum snapshot consolidation time if you want to stun the virtual machine for an extended period of time. 
 
              For example, you may want to increase the consolidation time to resolve an issue when the asynchronous consolidation fails after 10 iterations . By default, the snapshot consolidation time is set to 6 seconds.

Resolution

To increase the time limit of the snapshots consolidation, change the snapshot.maxConsolidateTime configuration parameter in the virtual machine to a higher value, such as 30 seconds:

Note: It is recommended to set this value to an optimum value of 30 seconds as this is usually sufficient to complete the required operations.
  1. Shut down the virtual machine.
  2. Right-click the virtual machine and click Edit Settings
  3. Click the Options tab. 
  4. Under Advanced, click General.
  5. Click Configuration Parameters and add snapshot.maxConsolidateTime = 30.

(2)How to monitor snapshot deletion using esxtop command (2146232) 

Purpose

This article provides information on monitoring the snapshot deletion using esxtop when time stamps are not updating for virtual-mode RDM base disks. 

Resolution

Monitor using esxtop in ESXi 4.x/5.x

  1. Log in as root to the ESX host using SSH. 
  2. Run the esxtop command.

    Note: This command works only if the virtual machine is powered on. 

  3. Press V to see only running virtual machines.

    Note: This is not the same as using the v option.

  4. Find the virtual machine running the consolidation.
  5. Type e to expand.
  6. Enter the Group World ID (value from GID column).
  7. Press Enter.
  8. Make a note of the World ID (ID column) of the snapshot consolidation process:

    • In ESX/ESXi 4.x, the process is called SnapshotVMXCombiner.
    • In ESXi 5.x, the process is called vmx-SnapshotVMX.
  9. Type u to display the disk device statistics.
  10. Type e to expand and enter the device where the snapshot consolidation process is writing to.

    For example: 

    naa.xxx
     value

    Notes:
    • For a regular vmdk file, the device is the datastore that the flat file is located.
    • For a flat vmdk, identifying the datastore device ID can be done by running esxcfg-scsidevs -m.
    • For RDM, the vmkfstools -q against the pointer file reveals the vml ID, which needs to be correlated with the output of ls -l /vmfs/devices/disks/ to get the device ID.
  11. Identify the Group World ID from step 6.

    Note: You may need to sort by MBREAD/s ( press R) or MBWRTN/s (press T) to see the process at the top of the screen.

  12. Look at the number IOPS and throughput for the Consolidation process (WRITES/s and MBWRTN/s columns) to ensure that there is activity and the process is working.

(3)VMware Tools fails with the error: vthread-3, Exception 0xC0000005 access violation has occured.

Symptoms

  • VMware Tools crashes on Windows 2003 terminal server
  • Vmware tools throws pop up error message, you see error message similar to:
vThread-3, exception 0xC0000005 access violation has occurred.

Cause

This issue occurs while accessing a RPCout channel pointer when it is NULL.

Resolution

This is a known issue affecting ESXi 5.1 and ESXi 5.5.

To resolve this issue, upgrade VMware tools.
 

For ESXi 5.1

This issue is resolved in ESXi 5.1 Patch 04, available at VMware Downloads. For more information, see VMware ESXi 5.1, Patch Release ESXi510-201404001 (2070666)

For ESXi 5.5
 
This issue is resolved in ESXi 5.5 Patch 04, available at VMware Downloads. For more information, see VMware ESXi 5.5, Patch Release ESXi550-201501001 (2099265)
 
 
 

(4)OVFtool to Copy VMs from one ESXi host to another.

In today’s post, we will see ow to use OVFtool to copy VMs from one host to another without having shared datastore between them.
The idea behind this article came from one of the questions that were directed to me recently regarding how to copy a VM from one host to another without having shared storage between them.

Now you could perform this from the vCenter Server if both the source and destination hosts are registered to the vCenter Server.
And yes, this operation cannot be performed when the Virtual Machine is in a power ON state even from the vCenter Server.

But if the two hosts were to be standalone hosts, then you could use another VMware product like VMware Converter, but it has its own set of issues.

Another method would be to download the files of the Virtual Machine to your local desktop and upload it to the local datastore of the destination host.

Now you can imagine the complexities and efforts that the above two tasks can take, which is when I came across the ovftool utility and was surprised to see that this can be done with no efforts and is the easiest way to probably do this.

And another good thing about the ovftool is that it is available for Windows, Linux, and MAC Operating Systems.

In our demo here, I will be making use of the Windows msi file to install on a Windows 8.1 machine which has access to both my source and destination hosts.

To download the latest version of the ovftool as of today, use the below link.

Download OVFTool

In our example, I have two ESXi hosts with the IP Addresses 192.168.1.15 and 192.168.1.16. I have a VM called DSL which I am interested in copying from one host to another.

The VM DSL is currently running on host 192.168.1.15 residing on the local datastore of that host (LocalESXiH)
First, you will open a command prompt to navigate to the directory where the ovftool is installed.

Run the below command to connect to the ESXi host remotely.
ovftool.exe vi://root@192.168.1.15
We are making the connection using the root account.
OVFtool to copy VMs
As you can see above, it is listing the VMs registered on the host and Test is one of them.

Now, we just need to specify the source ESXi host and the destination ESXi host as well as the datastore using the -ds option using the ovftool.

The actual copy of the VMs happens through the NFC protocol.
Here is an example of using ovftool to export the VM from one ESXi host to another ESXi host:
ovftool.exe -ds=LocalESXiF vi://root@192.168.1.15/DSL vi://root@192.168.1.16
OVFtool to copy VMs
There we go, you can see that the copy of the VM was successful from the above message.
But a couple of things to remember when you try this.
  • If you have snapshots running on the VM, then it will not copy over the delta files.
  • If you have thin provisioned disk, it will convert to thick provisioned on the destination datastore by default.
If you wish to learn more about the ovftool, kindly use the -h parameter to list out the available options.


 

 
 

 

 

 


 

             Create and Manage AD Users and Computers


Now we have the understanding of how and what an Active Directory Domain is and the terminology that is used and what are the roles and functionalities of the Domain Controller.

         Next up, we will look at the objects that can be part of the Domain, like Users and Computers.


   
In today’s objective, we will be looking at:
  • Create, Copy, Configure and Delete Users and Computers.
  • Configure Templates.
  • Configure User Rights.
  • Automate the creation of AD accounts.
  • Manage Inactive and Disabled accounts.
  • Perform Bulk AD operations.
  • Offline Domain Join.

 

Create, Copy, Configure and Delete Users and Computers

Users and Computers are one of the most important objects of the Active Directory Domain.
In this section, we will see the various ways available to create them.

Using Active Directory Users and Computers

To launch ADUC on your Domain Controller, go to Server Manger > Tools > Active Directory Users and Computers.
You can also go to Run and type dsa.msc to launch ADUC.
Right Click on any OU > New > User.
Exam 70-410 Objective 5.2 - Create and Manage AD Users and Computers
Provide the basic details like the First Name, Last Name, and the User logon name to create the user account.
Similarly, you can create a Computer account, by right clicking on an OU > New > Computer.
Exam 70-410 Objective 5.2 - Create and Manage AD Users and Computers
You just have to provide the computer name to add the object to the domain.

Using Active Directory Administrative Center

Administrators when using Windows Server 2003 and Windows 2008 had only the option of ADUC when managing objects in the AD domain.
From Windows Server 2008 R2 onwards, Microsoft introduces Active Directory Administrative Center, which is another of managing the Domain and is completely built on PowerShell.
I really like this tool as it is very modern and has some really cool features.
Exam 70-410 Objective 5.2 - Create and Manage AD Users and Computers
As you can see, the design is very modern and it is a little more intuitive than the ADUC.
Similarly, you can create both Users and Computers using this tool.

Using dsadd

dsadd is a command line utility available from Windows Server 2008. This utility will only be available if the ADDS Server Role is installed.


Dsadd
 
Applies To: Windows Server 2003, Windows Server 2008, Windows Server 2003 R2, Windows Server 2012, Windows Server 2003 with SP1, Windows 8
Adds specific types of objects to the directory.
Dsadd is a command-line tool that is built into Windows Server 2008. It is available if you have the Active Directory Domain Services (AD DS) server role installed. To use dsadd, you must run the dsadd command from an elevated command prompt. To open an elevated command prompt, click Start, right-click Command Prompt, and then click Run as administrator.

CommandDescription
Dsadd computer:Adds a single computer to the directory.
Dsadd contact:Adds a single contact to the directory.
Dsadd group:Adds a single group to the directory.
Dsadd ou:Adds a single organizational unit to the directory.
Dsadd user:Adds a single user to the directory.
Dsadd quota:Adds a quota specification to a directory partition.


dsadd user CN=AdilArif,CN=NewUsers,DC=enterprisedaddy,DC=com -pwd Password -disabled No
This will create a user called AdilArif in the NewUsers OU with the above password.
By default, the user is created and disabled, hence we are providing the parameter as NO.
Similarly, you can create computer account as well.
dsadd computer CN=Server1,CN=NewComputers,DC=enterprisedaddy,DC=com

Using PowerShell

Microsoft has made it very easy to administer most of the services of Windows Server using PowerShell.

How to create Active Directory Users with Powershell


 his is going to very interesting post as I will telling you different ways of creating users within Powershell. First things first, you need to make sure that you have Powershell installed on your machine. And also try and have Powershell 3.0, because it has some cool features from its predecessors. You can download Powershell 3.0 from here.
 
Once done, verify the version of Powershell opening up a Powershell window from start menu. Make sure you open the window by right-clicking and Run as Administrator. If you don’t, then trust me friends, BAD things happen!


You should see something similar to the below image.
Create Active Directory Users with Powershell
Now that we have taken care of the prerequisites, lets get to the meat of the article.
The cmdlet that helps you with creating a new user in an Active Directory domain is New-ADUser. I am sure that was difficult to guess. No it wasn’t!!
Trust me guys, the Powershell team has made it extremely easy for us to understand and use this cmdlets. They follow the Verb-Noun naming convention.
I always recommend that once you hear or know a new cmdlet, get the help files related to it and spend some time understanding it! The way you get the help is by simply typing the below:
Get-Help New-ADUser
You can also add different parameters at the end to get different forms of help file. Simply append -Examples to the above line and see what happens.
Voila! It gives a complete info along with a few examples as to how you can use that cmdlet.
Now lets go ahead and add a real user!
New-ADUser Ronnie
Assume that you want to see the user that you just created now. Do not worry my friends, it could not have got any simpler, just type the below:
Get-ADUser Ronnie
Create Active Directory Users with Powershell
Powershell will show everything that it has related to Ronnie. By default it shows only a few properties related to the user.
Let us say that you want to see all the properties associated with the user.
Get-ADUser Ronnie -Property *
The user Ronnie does not have many properties associated with him. You can see that there are lot of places that are left blank. That is because when we create Ronnie, we just gave his First Name.
Let us add his Last Name and give him a description so that you can easily find anything you want about Ronnie in future.
For this we will be using the Set-ADUser cmdlet. But you can also use Set-ADObject if you like to.
Again, I highly recommend that you go through the help files for each cmdlet that I have introduces in this post.
Get-ADuser Ronnie | Set-ADuser -Description "Ronnie is from the Marketing Team" -SurName "Hopkins" 
This was fun until you have couple of users to add. Imagine you get a list from someone saying that you have add 200 users today! I am sure that is going to be a pain.
Most often people will give the list of users with a csv file. Powershell lets you play with the csv files easily and make changes as per your wish. Assume that I have a csv file named newusers.csv
Make sure the first row of the csv file contains only the properties that are associated with the New-ADUser cmdlet.

#View users from CSV
Import-CSV ".\users.csv" | Out-GridView

Out-Grid View is just going to show the list on my screen in a nice format!
# Import users from CSV
Import-CSV ".\newusers.csv" | New-ADUser

We just imported the users and added them to the domain.

Before we continue, let us create a new Organizational Unit at the root of the domain.
New-ADOrganizationalUnit NewUsers
# Import users from CSV, set password, enable

Import-CSV ".\newusers.csv" |
New-ADUser `
-Enabled $True `
-AccountPassword $(ConvertTo-SecureString "P@55word" -AsPlainText -Force) `
-Company 'Enterprise Daddy.' `
-Path 'OU=NewUsers,DC=enterprisedaddy,DC=com'


In the above example we started to add the properties to the User accounts on the fly, the properties that were not mentioned in the csv file. Powershell gives you that flexibility and complete control.

Also note the character ` which you will find below the Esc key, this helps you make your code look clean and continue to the next line. Powershell will consider as though the code is continuing and is in the same line.


Configure Templates

In some cases, you are asked to create single user accounts, but they contain so many attributes, that it can be a time-consuming process.
We saw above that we can speed this up using various methods like dsadd.exe and New-ADUser cmdlet.
But there is another method in which you can create a user template.
A user template is a standard user account containing the most common attributes within the organization. You would usually start the name of the with the underscore.
Now if you have to create a user based on the template, you simply have  to right click on the template from ADUC and click on Copy.
Exam 70-410 Objective 5.2 - Create and Manage AD Users and Computers
Now you can enter the required information and enable the account.

Configure User Rights

To configure User Rights on a single machine, from Server Manager > Tools > Local Security Policies > User Rights management.
Exam 70-410 Objective 5.2 - Create and Manage AD Users and Computers
As mentioned before, the above mentioned is used for a single computer.
To configure for a whole of computers, we need to use Group Policy, which we will be discussing in the upcoming articles.

Automate the creation of AD Accounts

Some of the old ways of doing this are:

Using csvde.exe

A command line utility that can create new AD DS objects by importing from a CSV file.
The i parameter specifies import mode; without it, the default mode of CSVDE is export. The ‑f parameter identifies the file name to import from or export to. The ‑k parameter is useful during import operations because it instructs CSVDE to ignore errors.
The syntax is as below:
csvde.exe -i -f <filename.csv> [-k]

Using ldif.exe 

Like csvde.exe but with more functionality, LDIFDE is a utility that can import ADDS information and use it to add, delete or modify objects.
Exam 70-410 Objective 5.2 - Create and Manage AD Users and Computers


anage InActive and Disabled Accounts

For inactive accounts, the old way of doing it was to check the last logon date. This is when the user would have accessed the domain.
You can use PowerShell to achieve this.
Get-ADUser -Filter * -Properties lastLogonDate | Format-Table Name, lastLogonDate
Exam 70-410 Objective 5.2 - Create and Manage AD Users and Computers
To check disabled account, the old way is to check the account was enabled using the Get-ADuser cmdlet.
Get-ADUser -Filter {enabled -ne $true}
Exam 70-410 Objective 5.2 - Create and Manage AD Users and Computers
In the new OS, we have a new cmdlet to easily find inactive and disabled accounts.
Search-ADAccount -AccountDisabled
The above will list both the Users and Computer objects that are disabled within the domain.
Search-ADAccount -AccountDisabled -UsersOnly
Only Disabled user accounts will be displayed.
Similarly for Inactive accounts, you can check as below.
Search-ADAccount -AccountInActive
For Password related issues.
Search-ADAccoun t -PasswordExpired
Search-ADAccount -PasswordNeverExpires
Search-ADAccount -LockedOut

Perform Bulk AD Operations

As discussed in the above section, csvde.exe, ldif.exe, and PowerSehll were a few ways wherein one can automate the process of AD object creation, deletion and modification.

Offline Domain Join

During an offline domain join, a computer is configured to join a domain without contacting a domain controller.
This makes it easy to join the computers to the domain where there is no network connectivity.
I have written a complete guide on how to perform this procedure which you can find below.

Offline Domain Join – Add computers to domain

Windows Server 2008 R2 and Windows 7 introduce a new option for joining computers to a domain, called offline domain join.
As the name suggests, this features lets you join a computer to the domain if there is no network connectivity or the computer cannot contact the domain controller.
For this, we will be using a command called Djoin.exe on a computer which is part of a workgroup with the information required to join to the domain.

When would you use Offline Domain join feature?

This is an important that can be used for datacenters, virtualized desktop environments, where the machines are built and provisioned on demand.
It can also be used when the machine is built and used in a lab environment usually disconnected from the actual network. So when the machine is first started up when part of the network, it will already be a member of the domain. This also helps apply the required Group Policy at the start up.

What are the steps to be performed for Offline Domain Join?

Basically there are four major steps that need to be performed to join a computer to the domain using the Offline Domain Join method.
  1. Log on to the Windows Server 2008 R2 running the Active Directory Domain Services or Windows 7 machines running RSAT tools with the account having permission to add computers to the domain. (Domain Admins group has this permission by default)
  2. Use the DJoin command to provision a computer for offline domain join. This step prepopulates Active Directory with the information that Active Directory needs to join the computer to the domain, and exports the information called a blob to a text file.
  3. At the offline computer that you want to join the domain use DJoin to import the blob into the Windows directory.
  4. When you start or restart the computer, it will be a member of the domain.
Now that you understand the requirements to perform the Offline Domain join of a computer, ;ets dig in further to see how will you go about doing the same.

NOTE: The user who will perform this actions need to be a part of Domain Admins Group or should have equivalent permissions to add computers to domain.

Provision a Computer in Active Directory for Offline Domain Join

Run Djoin.exe from an elevated Command Prompt to provision the computer account in Active Directory. The basic syntax of DJoin is as follows:
djoin.exe /provision /domain DomainDNSName /machine ComputerName /savefile Filename
where
/provison parameter creates new computer account in Active Directory. You can also /reuse parameter if the computer account already exists in AD.
DomainDNSName is the DNS name of the domain. In our case it will be enterprisedaddy.com
ComputerName will be the name of the computer to be created or reused.
Filename will be the path and name of the File that we will output the blob to.
Now let us see an example of the command that we will be using in our demo here.
djoin.exe /provision /domain enterprisedaddy.com /machine CLIENT02 /savefile C:\CLIENT02_Join.txt /machineOU “OU=NewComputers,dc=enterprisedaddy,dc=com”
Note that I have given an extra parameter called machineOU which will create a computer account in the OU called NewComputers under root domain.
Similarly you can use switches like /dcname domainControllerName to define which DC you want to create the account in.
Moving ahead, the computer account called CLIENT02 will be created in NewComputers OU and information will be exported to the path C:\CLIENT02_Join.txt
So we have completed the steps that need to performed in Active Directory. Now this information needs to be injected in the computer that has to joined by the offline method.

Perform an Offline Domain Join

The account metadata that was exported in a blob to a text file by using Djoin.exe /provision can be imported to a computer, after which the computer will become a domain member at the next startup.

The command that you will run on the computer and its syntax can be seen below:
djoin.exe /requestODJ /loadfile Filename /windowspath %SystemRoot% /localos
where:
/requestODJ specifies that you want to perform an offline domain join operation.

Filename is the path and file name of the text file that contains the account metadata blob. This is the file that you created by using Djoin.exe /provision.

%SystemRoot% is the built-in Windows variable that represents the directory in which Windows is installed.

/localos specifies that you are injecting the domain join information into the local computer.

In our case, the command will be below assuming we have copied the file to the C drive of the local machine:
djoin.exe /requestODJ /loadfile C:\CLIENT02_join.txt /windowspath %SystemRoot% /localos

That’s it! Now when the computer is connected to the domain and is started, it will automatically add itself to the domain and be a member of the domain.








Wednesday, 27 July 2016

Something

About Windows

Windows

Windows Common Task with Run Command


To Access… Run Command
Accessibility Controls access.cpl
Accessibility Wizard accwiz
Add Hardware Wizard hdwwiz.cpl
Add/Remove Programs appwiz.cpl
Administrative Tools control admintools
Adobe Acrobat (if installed) acrobat
Adobe Photoshop (if installed) photoshop
Automatic Updates wuaucpl.cpl
Bluetooth Transfer Wizard fsquirt
Calculator calc
Check Disk Utility chkdsk
Clipboard Viewer clipbrd
Command Prompt cmd
Component Services dcomcnfg
Computer Management compmgmt.msc
Control Panel control
Date and Time Properties timedate.cpl
Device Manager devmgmt.msc
Direct X Control Panel (if installed)* directx.cpl
Direct X Troubleshooter dxdiag
Disk Cleanup Utility cleanmgr
Disk Defragment dfrg.msc
Disk Management diskmgmt.msc
Disk Partition Manager diskpart
Display Properties control desktop
Display Properties desk.cpl
Display Properties (w/Appearance Tab Preselected) control color
Driver Verifier Utility verifier
Event Viewer eventvwr.msc
Files and Settings Transfer Tool migwiz
File Signature Verification Tool sigverif
Findfast findfast.cpl
Firefox (if installed) firefox
Folders Properties folders
Fonts Folder fonts
Group Policy Editor (XP Prof) gpedit.msc
Hearts Card Game mshearts
Help and Support helpctr
HyperTerminal hypertrm
Internet Connection Wizard icwconn1
Internet Explorer iexplore
Internet Properties inetcpl.cpl
Internet Setup Wizard inetwiz
IP Configuration (Display Connection Configuration) ipconfig /all
IP Configuration (Display DNS Cache Contents) ipconfig /displaydns
IP Configuration (Delete DNS Cache Contents) ipconfig /flushdns
IP Configuration (Release All Connections) ipconfig /release
IP Configuration (Renew All Connections) ipconfig /renew
IP Configuration (Refreshes DHCP & Re-Registers DNS) ipconfig /registerdns
IP Configuration (Display DHCP Class ID) ipconfig /showclassid
IP Configuration (Modifies DHCP Class ID) ipconfig /setclassid
Keyboard Properties control keyboard
Local Security Settings secpol.msc
Local Users and Groups lusrmgr.msc
Logs You Out Of Windows logoff
Microsoft Chat winchat
Microsoft Excel (if installed) excel
Mouse Properties control mouse
Mouse Properties main.cpl
Nero (if installed) nero
Netmeeting conf
Network Connections control netconnections
Network Connections ncpa.cpl
Network Setup Wizard netsetup.cpl
Notepad notepad
ODBC Data Source Administrator odbccp32.cpl
On Screen Keyboard osk
Outlook Express msimn
Paint pbrush
Password Properties password.cpl
Performance Monitor perfmon.msc
Performance Monitor perfmon
Phone and Modem Options telephon.cpl
Power Configuration powercfg.cpl
Printers and Faxes control printers
Printers Folder printers
Regional Settings intl.cpl
Registry Editor regedit
Registry Editor regedit32
Remote Desktop mstsc
Removable Storage ntmsmgr.msc
Resultant Set of Policy (XP Prof) rsop.msc
Scanners and Cameras sticpl.cpl
Scheduled Tasks control schedtasks
Security Center wscui.cpl
Services services.msc
Shared Folders fsmgmt.msc
Shuts Down Windows shutdown
Sounds and Audio mmsys.cpl
Spider Solitare Card Game spider
SQL Client Configuration cliconfg
System Configuration Editor sysedit
System Configuration Utility msconfig
System File Checker Utility (Scan Immediately) sfc /scannow
System File Checker Utility (Scan Once At The Next Boot) sfc /scanonce
System File Checker Utility (Scan On Every Boot) sfc /scanboot
System File Checker Utility (Return Scan Setting To Default) sfc /revert
System File Checker Utility (Purge File Cache) sfc /purgecache
System File Checker Utility (Sets Cache Size to size x) sfc /cachesize=x
System Information msinfo32
System Properties sysdm.cpl
Task Manager taskmgr
TCP Tester tcptest
Telnet Client telnet
Tweak UI (if installed) tweakui
User Account Management nusrmgr.cpl
Utility Manager utilman
Windows Backup Utility (if installed) ntbackup
Windows Explorer explorer
Windows Firewall firewall.cpl
Windows Magnifier magnify
Windows Management Infrastructure wmimgmt.msc
Windows Media Player wmplayer
Windows Messenger msmsgs
Windows Picture Import Wizard (need camera connected) wiaacmgr
Windows System Security Tool syskey
Windows Update Launches wupdmgr
Windows Version (to show which version of winver

VMware



Virtual Machine Management Commands


  1. Command: #Services.sh restart
This command will restart all the management agents and services running on the host. You should see each service stopping and then being started.
  1. Command: #vim-cmd vmsvc
This is the most useful command for emergency maintenance and takes several extensions.
  1. Command: #vim-cmd vmsvc/getallvms
This command will display the list of virtual machines registered on the ESX/ESXi host (Powered Off or Powered On). The list contains additional information such as vmid, name of the virtual machine, Guest OS type, VM HW version, location of the virtual machine configuration file and annotations.
Vmid Name File Guest OS Version Annotation
  1. Command: #vim-cmd vmsvc/power.getstate <vmid>
This command will display the power status of the virtual machine in question.
  1. Command: #vim-cmd vmsvc/power.off <vmid>
This command will power off the virtual machine in question.
  1. Command: #vim-cmd vmsvc/power.on <vmid>
This command will power on the specified virtual machine and boot the Guest OS
  1. Command: #vim-cmd vmsvc/power.reboot <vmid>
This command will reboot the guest operating system.
  1. Command: #vim-cmd vmsvc/power.reset <vmid>
This command will reset the virtual machine in question.
  1. Command: #vim-cmd vmsvc/power.shutdown <vmid>
This command will shutdown the guest operating system running inside the virtual machine.
  1. Command: #vim-cmd vmsvc/power.suspend <vmid>
This command will suspend the virtual machine in question.
  1. Command: #vim-cmd vmsvc/power.suspendresume <vmid>
This command will revert the virtual machine from suspended state to normal state.
  1. Command: #vim-cmd vmsvc/power. Hibernate <vmid>
This command will place the guest operating system in standby mode.
  1. Command: #vim-cmd vmsvc/snapshot.create
Usage: snapshot.create <vmid> [snapshotName] [snapshotDescription] [includeMemory] [quiesced]
This command is used to take snapshot of the virtual machine.




Virtual Networking Commands
  1. How to create a standard virtual switch.
#esxcfg-vswitch -a <vswitch name>


EX: [root@server root]# esxcfg-vswitch –a vSwitch1


  1. How to add a port group to the virtual switch
#esxcfg-vswitch -A <Portgroup name> <vswitch name>


EX: [root@server root]# esxcfg-vswitch –A “Service Console” vSwitch1


  1. How to check whether the specified virtual switch exists or not
#esxcfg-vswitch -c <vswitch name>


  1. How to check whether the specified portgroup exists or not
#esxcfg-vswitch -C <portgroup name>


Output: Will print 1 if the virtual switch exists and 0 if not
  1. How to remove the virtual switch
#esxcfg-vswitch -d <vswitch name>
Output: Remove the virtual switch. This command fails if any ports on the virtual switch are in use by vmkernel networks or virtual machines.
  1. How to remove a port group from virtual switch?
#esxcfg-vswitch -D <port group> <vswitch name>
Output: Removes the port group. This command fails if any port group on the virtual switch is in use
  1. How to add an uplink adapter to the virtual switch ?
#esxcfg-vswitch -L <physical_nic> <vswitch_name>
Des: Running the command with this option attaches a new unused physical network adapter to a virtual switch

EX: [root@server root]# esxcfg-vswitch –L vmnic1 vSwitch1

  1. How to list all virtual switches and their port groups?
#esxcfg-vswitch -l

  1. How to remove an uplink adapter from the virtual switch?
#esxcfg-vswitch -U <physical_nic> <vswitch_name>

Des: Remove an uplink adapter from a virtual switch. An uplink adapter corresponds to a physical Ethernet adapter to which the virtual switch is connected. If you remove the last uplink adapter, you lose physical network connectivity for that switch.


  1. How to set VLAN ID for a specific port group?
#esxcfg-vswitch -v <vlan_id> --pg <portgroup_name> <vswitch_name>


EX: [root@server root]# esxcfg-vswitch -v <VLAN> -p “Service Console” vSwitch0
Des: Set the VLAN ID for a specific port group of a virtual switch. Setting the option to 0 disables the VLAN for this port group. If you specify this option, you must also specify the --portgroup option.



esxcfg-vmknic

The esxcfg-vmknic command adds, deletes, and modifies VMkernel network interfaces. In vSphere 5, equivalent ESXCLI commands are available.

  1. How to add a vmkernel nic to the system?
#esxcfg-vmknic -a -i <ip_address> -n <netmask> <portgroup_name>

EX: esxcfg-vmknic -a –i 192.168.5.6 –n 255.255.255.0 "VMkernel"


Des: Add a VMkernel NIC to the system. When the command completes successfully, the newly added VMkernel NIC is enabled.

  1. How to remove a vmkernel nic?
#esxcfg-vmknic -d <vmknic_name>

EX: esxcfg-vmknic -d "VMkernel"

  1. How to disable a specified vmkernel nic?
#esxcfg-vmknic --D --interface-name=<nic> --enabled=[true| false]

  1. How to enable a specified vmkernel nic?
#esxcfg-vmknic -e <vmknic_name>

  1. How to list all vmkernel nics?
#esxcfg-vmknic -l

EX: esxcfg-vmknic -lInterface  Port Group          IP Address      Netmask         Broadcast       MAC Address       MTU     TSO MSS   Enabled
vmk0       VMkernel            192.168.5.5    255.255.255.0   192.168.5.255  00:51:47:3c:20:cc 1500    40960     true

Esxcfg-route
Setting the vmkernel Default Gateway
  1. How to set vmkernel default gateway?
#esxcfg-route -a 19.2.168.100.0 255.255.255.0 192.168.0.1
Or
#esxcfg-route -a default 192.168.0.1
  1. How to delete a vmkernel gateway?
#esxcfg-route -d 192.168.100.0/24 192.168.0.1
  1. How to list vmkernel gateway configured?
#esxcfg-route -l


Esxcfg-vswif


Used to configure service console networking in 4.x systems. Not needed and not available in the ESXi 5.x ESXi Shell

  1. How to display service console interface?
#esxcfg-vswif -l
EX: esxcfg-vswif -l
Name     Port Group          IP Address       Netmask          Broadcast        Enabled   DHCP
vswif0   Service Console     192.168.5.5     255.255.255.0    192.168.5.255   true      false
  1. How to add a new service console networking interface?
#esxcfg-vswif -a -p “service console” -i <ip address> -n <netmask> vswif0
  1. How to delete a service console networking interface?
#esxcfg-vswif -d vswif0




Interview Questions

szddxf

Sunday, 24 July 2016

Interview questions

1)What is service console?
A) The service console is developed based up on Redhat Linux Operating system,it is used to manage the vmkernel.

2)What are the basic commands to troubleshoot connectivity between vsphere client/vcenter to esx server?
(A)--->service mgmt-vmware restart
           (restarts host agent(vmware-hostd)on vmware esx server))
   
     ---->service vmware-vpxa restart(restarts vcenter agent service)

      ----->service network restart(restarts management networks on esx)


(3)what is vcenter agent?
(A)vc agent is an agent installed on esx server which enables communication between vc and esx server.This agent will be installed on esx/esxi will be done when you try to add the esx host in vcenter.

(4)what is the command used to restart SSH,NTP&vmware web access?
(A)
        (1)service sshd restart
        (2)service ntpd restart
        (3)service vmware-webaccess restart

(5)what are the types of port groups in esx?
(A)There are 3 types of port groups in esx

         (1)service console port group
         (2)vmkernel port group
         (3)virtual machine port group
      
                  There are only 2 types of port group in esxi
               
                      (1)vmkernel port group
                      (2)virtual machine port group

(6)what is vmkernel?
(A) vmkernel is a proprietary kernel of vmware and is not based on any of the flavors of linux operating systems.vmkernel requires an os to boot and manage the kernel.A service console is being provided when vmware kernel is booted.only service console is based up on redhat linux os not vmkernel.

(7)what is the use of service console port?
(A)service console port group required to manage the esx server and it acts
as the management network for the esx.vcenter/vsphere clent uses the service console ip's to communicate with the esx server.

(8)what is the use of vmkernel port?
(A)vmkernel port is used by esx/esxi for vmotion,iscsi&nfs communications.esxi uses vmkernel as the management network.since it dont have service console built in it.

(9)what is the use of virtual machine port group?
(A)virtual machine port group is used by virtual machine communication.

(10)How virtual machine communicates to another servers in network?
 (A)All the virtual machines which are configured i vm port group are able to connect to the other machines on the network.So this port group enables communication between Vswitch and physical switch by the use of uplink associated with  the port group.

(11)What is the default number of ports configured with the virtual switch?
 (A) When the time of virtual switch created,vswitch is creted with 56 ports by default.We can extend the no of ports by editing the vswitch properties.

(12)What are the different types of partitions in esx server?
(A)  /-root
       Swap
       /var
       /var/core
      /opt
       /home
      /tmp