Friday, December 14, 2012

Step-by-step: Using the Microsoft iSCSI Software Target with Hyper-V (Standalone, Full, VHD)

Overview
In this post, I will show all the steps required to run Windows Server 2008 Hyper-V with the Microsoft iSCSI Software Target. We will cover the specific scenario of a standalone Windows Server 2008 server (as opposed to a clustered one) on a full install (as opposed to a core install) and using a VHD file (as opposed a pass-through disk).
In order to follow these instructions you will need at least two computers. One computer will run a full install of Windows Server 2008 with the Hyper-V role enabled. The other computer needs to be a Windows Storage Server (WSS) with the iSCSI pack or Windows Unified Data Storage Server (WUDSS). Optionally, you could add a Client for your Virtual Machine and a computer for remote Hyper-V Management.
Configuring the Networks
For your server running Hyper-V, you should consider having at least three Network Interface Cards (NICs). One will be dedicated to iSCSI traffic. The second will be connected to the Virtual Switch and used for traffic going to your virtual machine. The third NIC you will dedicate to remote management. This configuration is showed in the diagram below:
01 
Checking the Windows Storage Server
WSS (with the Microsoft iSCSI Software Target) comes preinstalled from the hardware vendor. This special OS release is not available the Microsoft sales channels like software retailers or volume licensing. You can find more information about WSS and WUDSS at http://www.microsoft.com/storageserver. Windows Storage Server 2008 is also available from MSDN or TechNet subscriber downloads for non-production use (see details at http://blogs.technet.com/josebda/archive/2009/05/13/windows-storage-server-2008-with-the-microsoft-iscsi-software-target-3-2-available-to-msdn-and-technet-plus-subscribers.aspx).
You should make sure you have the proper credentials (username and password) with administrator privileges on the Storage Server. You should also make sure you have remote access to the Storage Server via Remote Desktop. Once you log on to the Storage Server via Remote Desktop, verify that you can locate the Microsoft iSCSI Software Target Management Console (MMC), which can be found in the Administration Tools menu. From a Storage Server perspective, we’ll perform all the configuration actions using the iSCSI Target MMC.
02 
Checking the Server running Hyper-V
On the server running Windows Server 2008 Hyper-V, you should make sure to run Windows Update to get the latest updates. This will ensure that you have the final release of Hyper-V, not the beta version that was released with Windows Server 2008.
You will also need to enable the Hyper-V role. This is done using Server Manager by right-clicking the “Roles” node on the tree on the left and selecting “Add Roles”.
03
This will bring up the “Add Roles Wizard”, where you will find “Hyper-V” on the list of roles:
 04
While configuring the Hyper-V role on the wizard, you should see the three (or more) NICs on your server on the “Create Virtual Networks” step.
Make sure you do not select the NICs used for iSCSI traffic and Hyper-V remote management in the “Create Virtual Networks”.
05
You will need to restart the server after you add the Hyper-V role.
Loading the iSCSI Initiator
The next step now is to configure the iSCSI initiator on the Hyper-V server.
You can find the “iSCSI Initiator” under “Administrative Tools” in Windows Server 2008. You can also find it in the “Control Panel”.
The first time you load the iSCSI initiator, it will ask you two questions.
The first question is about loading the Microsoft iSCSI Initiator service every time:
06
The second question is about configuring the firewall to allow the iSCSI traffic:
07
You should click on “Yes” for both questions.
After that, the iSCSI Initiator Properties windows will load, showing the “General” tab.
This tab gives you an important piece of information: your initiator name or IQN. We’ll need this later when configuring the target:
07
Configuring the target portal
The next step is configure the initiator with the address of your iSCSI target portal.
In our case, this is the computer running Windows Storage Server and the Microsoft iSCSI Software Target.
In the iSCSI Initiator Properties window, select the “Discovery” tab and add the IP address of the Storage Server to the list of Target Portals.
09
Click on “Add Portal…” to add the information. You will need the IP address of your Storage Server at this point. Port 3260 is the default.
10
Here’s the screen after the Target Portal is added:
11
Now, if you switch over the “Targets” tab of the iSCSI Initiator Properties windows, you will see this:
12
This blank list of targets is expected at this point, since we haven’t configured any targets yet.
We’ll do that next.
Creating the iSCSI Target
Now we switch over the Microsoft iSCSI Software Target side, on the Windows Storage Server.
We will create the target using the Microsoft iSCSI Software Target MMC we mentioned before.
13
After starting the wizard, skip the introduction page by clicking “Next”.
14
Next, you will provide the name and description for the target. We’ll be using simply “T1” for the name.
15
On the following screen, you need to provide the identification for the target.
Here you can use an IQN (iSCSI Qualified Name) or you can use the advanced setting to go with an IP address, DNS name or MAC address.
16
Since our initiator in this case already contacted the Storage Server, you can simply click on “Browse” and pick the IQN from there.
17
Once you get the right IQN, click “Next” to proceed.
18
Finally, click “Finish” to create the target.
19
Adding LUNs to the iSCSI Target
Now that the target is created, you need to add virtual disks or LUNs to it. These will be the logical units that will be presented to the initiator.
You will do this by right-clicking the target T1 and selecting the option to “Create Virtual Disks for iSCSI Target”.
20
You will start the wizard. Click “Next” on the introduction page.
21
Next, you will provide a path to the file to use as your virtual disk or LUN. This file will have a VHD extension.
22
Next, you will specify the size for the virtual disk or LUN. We’ll create a 20GB LUN here, which is enough to install Windows Server 2008 later on. The iSCSI target uses fixed-sized VHD files, but you can extend them if needed.
23
Next, you will specify a description for the virtual disk or LUN.
24
Finally, click “Finish” to create the virtual disk. Depending on the size, it could take a while.
25
At this point, you can see the target and its virtual disk on the Microsoft iSCSI Software Target MMC:
26
You can check the properties of the target, including the target IQN, by right-clicking the target name and clicking on “Properties”.
27
Now we go back to the initiator side.
Configuring the iSCSI Initiator targets
When we last checked the “Targets” tab of the iSCSI Initiator Properties windows, we had an empty list.
With the target properly configured, you should see the it showing after you click on “Refresh”:
28
Now you need to click on “Log on…” to connect to the target.
On the “Log On to Target” window, be sure to check the box to “Automatically restore this connection when the computer starts”.
29
Once you log on, the target status will change to “Connected”.
30
The LUN should also appear in the list of “Volumes and Devices” in the iSCSI Initiator Properties:
31
Now we need to work on that LUN to turn it into an NTFS volume with a drive letter.
That is done in Disk Management.
Preparing the Volume
If you followed all the steps so far, you should already have the LUN as an offline, uninitialized, unallocated volume in Server Manager, under Disk Management:
32
The first thing you need to do here is to online the volume, by right-clicking on the disk:
33
The volume will be onlined automatically if you are running the Standard Edition of Windows Server 2008.
After that, the volume will be online, but still uninitialized. You will then select the option to “Initialize Disk”:
34
At this point you need to select a partition style (MBR or GPT). The older MBR style is commonly used for small partitions. GPT is required for partitions larger than 2TB.
35
After this, you have a basic disk online which you could use to create an NTFS volume. If you right click it again, there will be an option to create a “New Simple Volume”.
36
Once you go through that wizard, format the volume and assign it a drive letter, you will have the final result in Disk Management as drive E:
37
We’ll use this drive E: as our storage for Hyper-V.
Creating the Virtual Machine
Last but not least, we must now create our Virtual Machine. We’ll do this in the Hyper-V Manager:
38
There are two places in the New Virtual Machine Wizard where you will refer to the E: disk.
The first one is when you select the location of your virtual machine configuration files:
39
The second one is when you specify the location of the virtual hard drive used by that virtual machine:
40
In this case, by using the wizard, we selected the default option of using a Dynamically Expanding VHD file that is exposed to the child partition as Virtual IDE.
You can verify that looking at the settings for the resulting Virtual Machine:
41
If you click on the “Inspect” button, you can see it’s a Dynamic VHD:
42
You could, of course, use any of the other types of VHD files or even a pass-through disk, but that’s a topic for another blog post…
Conclusion
I hope this blog post has helped you understand all the steps required to use the Microsoft iSCSI Software Target to provision storage for your Windows Server 2008 server running Hyper-V.
This post covered a scenario where Hyper-V runs on a full install of Windows Server 2008, using a VHD file on the parent and without Failover Clustering.

Thanks
R.karthikeyan
9782829889/9772655552

Thursday, December 13, 2012

Creating a SAN using Microsoft iSCSI Software Target 3.3


When Microsoft released their iSCSI Software Target to general download in April they opened up a world of possibilities for smaller companies (as well as IT Pros and hobbyists) who use servers, but cannot justify spending thousands of dollars on a Storage Area Network (SAN) device. In this article I will show you how to create a virtual SAN in your environment.
Installing the iSCSI Software Target (available here: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=45105d7f-8c6c-4666-a305-c8189062a0d0) is a simple process. It comes as a self-extracting package which installs seamlessly on any Windows Server 2008 R2 operating system (RTM or SP1). Once installed it appears under Administrative Tools.
clip_image002
clip_image004Before we create our iSCSI Target we will create two VHD files: One as our Witness Disk and one for Shared Storage. Right-click on Devices and click Create Virtual Disk.
In the Create Virtual Disk Wizard type the full name (including directory structure) of the VHD file you want to create. The Witness Disk does not have to be very big (8GB is my norm), but the Shared Storage Disk should be as large as you would need it to be… depending on what you will be storing it might need to be quite large.
1. In the Welcome screen click Next.
2. In the File screen type the name and location of the VHD file you want to create (c:\disks\Witness.vhd) and click Next.
3. In the Size screen enter the size of the VHD in megabytes (for the Witness disk enter 8192) and click Next.
4. In the Description screen enter a description (Witness Disk) and click Next.
5. On the Access screen click leave the fields blank and click Next. We will configure this once we create our Target.
6. On the Completing the Create Virtual Disk Wizard screen click Finish.
clip_image006Make sure to repeat these steps for the Shared Storage disk, changing only the file name, description, and size appropriately.
For each VHD two files will be created – the Virtual Hard Disk file which will be Fixed Disks, and a Microsoft iSCSI Software Target Change Tracking Bitmap file, which is a .cbm file that Microsoft uses for integrity checking.
Now that our storage is allocated we will create our iSCSI Target. To begin we will right-click on iSCSI Targets in the navigation pane and click Create iSCSI Target.
1. In the Welcome screen click Next.
2. In the iSCSI Target Identification screen enter the name of your iSCSI target. This will be the name of your Logical Unit Number (LUN). You can also optionally enter a description. Click Next.
NOTE: Although not a requirement, it is a best practice to exclude punctuation, especially periods and dashes, as they are used in the iSCSI Qualified Name (IQN) that will be created by both the target and initiator.
3. In the iSCSI Initiators Identifiers screen we will select the Windows machines that will be able to access the iSCSI target. Click on Advanced… to enter the DNS domain name, IP address, MAC address, or multiple pre-determined IQNs. In most cases the iSCSI Initiators of your devices will not have been enabled yet, but by entering their IP address you can save extra steps later.
clip_image008There are two components of an iSCSI SAN – the target, which is the LUN on the actual SAN device, and the initiator, which is the computer that will be accessing it. Because SANs are commonly used with clusters, it is possible to have several initiators configured to access a single target. However if the target is not configured for the initiator, it will be invisible to that system when it tries to access it.
4. Click Next on the iSCSI Initiators Identifiers screen, then click Finish on the Completing the Create iSCSI Target Wizard screen.
clip_image010At this point your iSCSI target has been created. We can look at the properties by right-clicking on the iSCSI Target we created and click Properties.
The LUN properties box should have five tabs: General, iSCSI Initiators, Authentication, Virtual Disks, and Advanced.
Under the General tab you will see (for the first time?) your IQN. In the example created for this article it is iqn.1991-05.com.microsoft:ski-storage-lun1-target. This convention may appear long and convoluted, but it can be broken down into two parts… the device manufacturer and the actual target.
Because we are using the iSCSI Software Target, the manufacturer is Microsoft, and because their domain name (microsoft.com) was registered in May of 1991 the first part of our iqn is 1991-05.com.microsoft. (If you had an EMC device, you would have an IQN of iqn.1997-07.com.emcJ
The first part of the IQN is separated from the second part by a colon. The actual target (LUN1) is on a server called Ski-Storage, hence ski-storage-lun1-target.
Under the iSCSI Initiators tab you can see, add, edit, and remove initiators. This will be important if you plan to add new initiators to a cluster, for example.
Under the Authentication tab you can set CHAP (Control Host Authentication Protocol). This is the only method of authentication supported by iSCSI.
Under the Virtual Disks tab we will add our pre-created VHDs.
1) Click Add…
2) Select both disks and click OK.
3) In the LUN Properties screen click OK.
At this point our LUN is created and populated, and ready to go! Now it is a simple matter of pointing our initiators to the device.
In Windows Server, click Start – Administrator Tools – iSCSI Initiator to launch the iSCSI Initiator. If this is the first time you are running it on your server you will be warned that in order to run the Initiator, the Microsoft iSCSI Initiator Service must be running, and that Windows will configure it to auto-start.
In the iSCSI Initiators Properties box there are six tabs: Targets, Discovery, Favorite Targets, Volumes and Devices, RADIUS, and Configuration.
clip_image012In the Targets tab type the IP address of the server on which you configured your software target, and click Quick-Connect… In the event of a successful connection a Quick Connect window will appear with the IQN of your iSCSI target and the status Connected in the Status column. Click Done to close the Quick Connect window.
The IQN of your target will now appear in the Discovered Targets list on the Targets tab.
Click on the Volumes and Devices tab of the iSCSI Initiator Properties window. The Volume List should be blank. Click Auto Configure to automatically configure all of the devices on the discovered target. Two devices should appear.
clip_image014
The rest of what we are doing should be pretty familiar to you.
1) Open Server Manager.
2) Navigate to Disk Management.
There should be two new disks attached to your server.
3) Right-click the 8.00 GB disk and click on-line. Right-click the 64.00 GB disk and click on-line.
4) Right-click the 8.00 GB disk and click Initialize. The Initialize Disk screen should appear, allowing you to select both disks to be initialized. Click OK.
5) Create a Simple Volume on each disk.
a. On the 8.00 GB disk right-click on the unallocated space and click Create Simple Volume.
b. In the New Simple Volume Wizard click Next.
c. In the Specify Volume Size screen click Next.
d. In the Assign Drive Letter or Path screen select Q and click Next.
e. In the Format Partition screen change the Volume Label to Witness Disk and click Next.
f. On the Completing the New Simple Volume Wizard screen click Finish.
Repeat the same steps for the 64.00 GB disk, replacing the drive letter with M and the label to Shared Storage.
At this point your LUN is created, formatted, and ready for data!
In the next article we will use this LUN to create a cluster, and configure that cluster to make a Hyper-V Virtual Machine Highly Available.

Hi If you found this post useful then kindly share your view and feed back through comments.

Thanks
R.karthikeyan
9782829889/9772655552

Wednesday, December 12, 2012

How to Backup and Restore Active Directory on Server 2008

Topics Mentioned
Operating System(s):
Have you ever accidentally deleted a user account or an OU in Active Directory and wished you could restore it?
I recently had a client call me after they installed updates and rebooted their server. They noticed after the reboot that there was a message that said “Active Directory is rebuilding indices. Please wait”.
Their Active Directory database had become corrupted from the updates. So what do you do? How can you restore AD?
Let’s talk about how to backup AD in Windows Server 2008 and how to restore it. Today I’ll show you:
  • what you need to do to get your Server 2008 ready for backup
  • how to backup Active Directory on Server 2008
  • how to perform an Authoritative Restore of Active Directory
  • how to perform Active Directory Snapshots

Prerequisites: Getting Server 2008 Ready for Backup

Before you can backup Server 2008 you need to install the backup features from the Server Manager.
1. To install the backup features click Start → Server Manager.

How to Backup and Restore Active Directory on Server 2008 - 1
2. Next click Features → Add Features


How to Backup and Restore Active Directory on Server 2008 - 2
3. Scroll to the bottom and select both the Windows Server Backup and the Command Line Tools


How to Backup and Restore Active Directory on Server 2008 - 3
4. Click Next, then click Install

Backing up Server 2008 Active Directory

Now that we have the backup features installed we need to backup Active Directory. You could do a complete server backup, but what if you need to do an authoritative restore of Active Directory?
As you’ll notice in Server 2008, there isn’t an option to backup the System State data through the normal backup utility.


How to Backup and Restore Active Directory on Server 2008 - 4
So what do we do? We need to go “command line” to backup Active Directory.
1. Open up your command prompt by clicking Start and type “cmd” and hit enter.
2. In your command prompt type “wbadmin start systemstatebackup -backuptarget:e:” and press enter.
Note: You can use a different backup target of your choosing
3. Type “y” and press enter to start the backup process.


How to Backup and Restore Active Directory on Server 2008 - 5
When the backup is finished running you should get a message that the backup completed successfully. If it did not complete properly you will need to troubleshoot.


How to Backup and Restore Active Directory on Server 2008 - 6
Now you have a system state backup of your 2008 Server!

Authoritative Restore of Active Directory

So now what if you accidentally delete an OU, group, or a user account and it’s already replicated to your other servers? We will need to perform an authoritative restore of the Active Directory object you accidentally deleted.
1. To do this you will need to boot into DSRM (Directory Services Restore Mode) by restarting your server and pressing F8 during the restart.
2.Choose Directory Services Restore Mode from the Advanced Boot menu.


How to Backup and Restore Active Directory on Server 2008 - 7
3. Login to your server with your DSRM password you created during Active Directory installation.
4. Once you’re logged into your server and in DSRM safe mode, open a command prompt by clicking Start, type “cmd“, and press enter.
5. To make sure you restore the correct backup it’s a good idea to use the “wbadmin get versions” command and write down the version you need to use.


How to Backup and Restore Active Directory on Server 2008 - 8
6. Now we need to perform a non-authoritative restore of Active Directory by typing “wbadmin start systemstaterecovery -version:04/14/2009-02:39“.
Note: The version of backup will vary depending on your situation. Type “y” and press enter to start the non authoritative restore.
7. Go grab some coffee and take a break while the restore completes.


How to Backup and Restore Active Directory on Server 2008 - 9
8. You can mark the sysvol as authoritative by adding the –authsysvol switch to the end of the wbadmin command.


How to Backup and Restore Active Directory on Server 2008 - 10
9. But if you want to restore a specific Active Directory object then you can use the ever familiar ntdsutil.
For this example we are going to restore a user account with a distinguished name of CN=Test User,CN=Users,DC=home,DC=local. So the commands would be:
ntdsutil
activate instance ntds
authoritative restore
restore object “cn=Test User,cn=Users,dc=home,dc=local”
Note: The quotes are required


How to Backup and Restore Active Directory on Server 2008 - 11
10. Reboot your server into normal mode and you’re finished. The object will be marked as authoritative and replicate to the rest of your domain.

Using Active Directory Snapshots

There is a really cool new feature in Windows Server 2008 called Active Directory Snapshots. Volume Shadow Copy Service now allows us to take a snapshot of Active Directory as a type of backup. They are very quick to create and serve as another line of defense for your backup strategy.
With your server booted into normal mode open a command prompt by clicking Start, type “cmd“, and press enter.
We are going to use the ntdsutil again for creating the Active Directory snapshots. The commands are:
ntdsutil
snapshot
activate instance ntds
create
quit
quit

How to Backup and Restore Active Directory on Server 2008 - 12
So now that you have a snapshot of AD, how do you access the data? First we need to mount the snapshot using ntdsutil. The commands are:
ntdsutl
snapshot
list all
mount 1
— (Note: You should mount the correct snapshot you need; for this example there is only 1.)
quit
quit

How to Backup and Restore Active Directory on Server 2008 - 13
Your snapshot is mounted, but how do you access the data? We need to use the dsamain command to accomplish this. Then we need to select an LDAP port to use. The command is as follows:

dsamain –dbpath c:\$SNAP_200905141444_VOLUMEC$\WINDOWS\NTDS\ntds.dit –ldapport 10001
The result should look like this:


How to Backup and Restore Active Directory on Server 2008 - 14
Now we need to go to Start, Administrative Tools, then Active Directory Users and Computers.
Right click Active Directory Users and Computers and select Change Domain Controller.


How to Backup and Restore Active Directory on Server 2008 - 15
In the area that says < Type a Directory Server name [:port] here > enter the name of your server and the LDAP port you used when running the dsamain command.
For my example it would be: WIN-V22UWGW0LU8.HOME.LOCAL:10001


How to Backup and Restore Active Directory on Server 2008 - 16
Now you can browse the snapshot of Active Directory without affecting anything else negatively.

Your AD Backup Strategy

It’s always good to have a solid backup plan for your Active Directory. You can use a combination of backup strategies or just one of these methods for backing up your Active Directory.
Make sure you tailor your Active Directory backup strategy to meet your company’s needs and make it easy to recover if disaster does strike.


 Thanks
------------------
R.karthikeyan
9782829889/9772655552

Share this

Labels

WINDOWS SERVER (22) Windows (20) IIS (15) Interview questions (10) TFS (9) Troubleshooting Tips (9) Fortigate Firewall (8) SQL (8) Backup (6) Team Foundation Server (6) Webserver (6) Windows Administration Task (6) Microsoft certification (5) Virtualization (5) ADDS (4) Active Directory (4) FTP (4) PHP (4) SQL 2012 (4) SQL Server (4) server (4) DBA (3) MSSQL (3) Networking (3) Offer (3) Webhosting (3) Windows 8 (3) 74-409 (2) Agile Methodology (2) Apache (2) CLI Commands (2) DNS (2) Dedicated server (2) Difference between Active and Passive Connection Mode (2) Fortinet (2) GPO (2) IIS8 (2) IPAddress (2) IPV6 (2) MVA (2) Microsoft News (2) NAT (2) Software Development (2) TFS2013 (2) Uncategorized Post (2) XAMPP (2) firewall Administration. (2) powershell (2) .htaccess (1) ALM (1) Agile vs Scrum Difference (1) Blogging TIPS (1) CPanel (1) Command for Administrator (1) DC (1) DHCP (1) Domain joining nano server (1) Exam 74-409 (1) Excel TIps (1) File server (1) Fortigate Firewall HA (1) Fortigate Firmware Upgrade (1) Free Exam 70-740 (1) Free Voucher (1) Generation2 VM (1) Group Policy (1) HP (1) HP ILO IP CHange (1) HP OA IP Change (1) HP Proliant Servers (1) HTTP to HTTPS (1) Hyper-V (1) IAS (1) IIS Server hardening (1) ILO (1) Install dll (1) MCSA 2016 (1) Microsoft Virtual Academy (1) Microsoft file sharing Port (1) Migration (1) MySQL (1) NPS (1) Nano server (1) Network Drive (1) OA (1) Plesk Panel (1) Ports (1) Ports for windows file sharing (1) RADIUS (1) RDP (1) Remote Desktop Connection (1) SCRUM (1) SQL ErrorLog (1) SQL TEMPDB (1) Second Shot (1) Server 2012 (1) Startup Parameters (1) TEMPDB Movement (1) TIPS (1) Team Foundation Server 2013 (1) Temp profile. (1) Troubleshooting DNS (1) URL Rewriting (1) VDOM (1) VPS (1) VSS (1) Virtual Labs (1) Visual Studio (1) Visual Studio 2012 (1) Visual Studio 2013 (1) Visual source safe (1) Waterfall Model vs Agile Methodology (1) Windows 2016 (1) Windows 7 (1) Windows Server 2012 (1) Windows command line (1) XP (1) certification path (1) exam (1) free online courses (1) protocols/ports for windows file sharing on a firewall (1) sql error (1) what features has been installed in your SQL Server (1) windows 2012 (1) windows Time Service (1) work item types difference (1)

E-Books

Blogger Gadgets