Translate

Showing posts with label Windows Server 2012. Show all posts
Showing posts with label Windows Server 2012. Show all posts

Thursday, February 5, 2015

Tự học MCSA 2012 Distributed File System (DFS)


Ở bài học hôm nay, mình xin trình bày về Distributed FIle System hay còn gọi là DFS.

DFS (Distributed File System): Hệ thống file phân tán có từ thời 2k8.
Đối tượng triển khai: File Server
Mục đích triển khai: Hướng đến 2 mục tiêu (hoặc 1 trong 2).
Mục tiêu 1: Chia tải và chịu lỗi
+ Chia tải (Load Balancing): tại 1 thời điểm, nếu file server chỉ có 1, nó tiếp nhận quá nhiều kết nối thì sẽ xử lý không nổi => ta nên xây dựng từ 2 file server trở lên để có thể chia tải
=>dữ liệu trên các file server cần phải đồng nhất ( muốn đồng nhất thì admin copy từ server này sang server kia nếu có sự thay đổi !!!! )
+ Chịu lỗi (Fail Over): Nếu có 1 file server mà bị chết bất ngờ thì tiêu… Ta cần nhiều server để dự phòng => dẫn đến server 1 hỏng thì phải thông báo cho user để họ chuyển sang truy cập server khác !!!!).
Chỉ riêng việc chia tải và chịu lỗi cũng  làm mệt admin rồi
DFS giúp ta chia tải tự động, đồng bộ dữ liệu tự động. Chịu lỗi trong suốt đối với user ( 1 server chết thì user cũng không biết, vẫn có thể truy suất file server bình thường).
Mục tiêu 2: Tập hợp dữ liệu
Công ty có nhiều chi nhánh, mỗi chi nhánh có 1 file server => dữ liệu trên các file khác biệt nhau
Tại văn phòng chính, ta muốn dữ liệu trên các file server của chi nhánh tập hợp về văn phòng chính
Ta có 2 cơ chế làm việc này
+ Nhân viên cầm USB đến các chi nhánh copy dữ liệu mỗi chiều ( !!!!)
+Tự động tập hợp về văn phòng chính ( dùng DFS).

Mình đã trình bày mục đích cũng như tình huống để sử dụng DFS. Ta hãy cùng tìm hiểu về các khái niệm liên quan đến DFS
Namespace: đường dẫn luận lý mà user sẽ truy cập.
Trong namespace là cây thư mục
Có 2 loại thư mục:
+ Loại 1: Chỉ mang tính chất cấu trúc ( chỉ dùng để bố trí, phân nhóm, sắp xếp dữ liệu)
+ Loại 2: Có target folder – Là 1 share folder ( dữ liệu lưu trữ ở file server).
Namespace được lưu trữ trong Namespace Server
Namespace Server quản lý  Namespace và đường dẫn vật lý đến các target folder (Namespace server được xem như người dẫn đường)
Yêu cầu khi triển khai DFS:
+ Số lượng File Server ít nhất là 2 trở lên.
+ Namespace Server nên có 2 cái trở lên ( vì nếu 1 cái thì khi hỏng sẽ không thể dẫn đường đến các file server)
Có 2 loại môi trường:
Stand Alone: dành cho các server ở workgroup muốn triển khai DFS ( chỉ có thể tạo 1 namespace server)
Domain: có thể tạo 2 namespace server trở lên
Có thể tích hợp : File server vào namespace server
Thực tế khi triển khai DFS: ta cần 2 server vật lý. Trên mỗi server ta sẽ đồng thời là file server và namespace server (như vậy ta có 2 file server, 2 namspace server).
Cấu trúc namespace sẽ được lưu trữ trên namespace server trong thư mục DFS root. Nó chứa cấu trúc dữ liệu lưu trữ trên file server.
Nếu lấy Namespace server và File server chung 1 máy thì thường hay bị nhầm lẫn giữa cấu trúc namspace với không gian lưu trữ dữ liệu (file server) => dẫn đến việc admin nhầm lẫn cấu hình cho phép người dùng lưu trữ trên DFS root (DFS root để quản lý nên chỉ những người có chức năng mới được cấp quyền).
Replication Group:  là thông số sẽ xác lập việc đồng bộ giữa các file server bao gồm 3 yếu tố:
+ Yếu tố 1: Các file server nào, đồng bộ các folder nào
+ Yếu tố 2: Topology : là cấu trúc mà các server trao đổi thông tin. Gồm 3 loại:
1/ Hub-Spoke: ( Các Spoke đồng bộ về Hub)
Điều kiện: ít nhất 2 spoke member và 1 hub member ( tối thiểu 3 máy).
Dùng trong trường hợp: tập hợp dữ liệu( tập hợp dữ liệu ở chi nhánh (Spoke) về văn phòng chính (Hub).
Hub-Spoke
Topology DFS
2/ Full Mash:  (Bao nhiêu server cũng được)
Một Server sẽ đồng bộ với mọi server còn lại
Dùng cho mục tiêu chia tải và chịu lỗi

3/ Custom: Giống Full Mash nhưng bỏ vài hướng kết nối. Chúng ta có thể tự mình tạo cơ chế đổng bộ dựa vào dạng này (VD: Ring topology)

+ Yếu tố 3: Cơ sở cho hoạt động đồng bộ. Có thể chọn 1 trong 2
a/ Percent Bandwidth: định ra hoạt động đồng bộ sẽ chiếm bao nhiêu phần trăm (%) trong tổng băng thông khả dụng (Bandwidth). Hoạt động đồng bộ sẽ thực hiện 24/7.Thường dùng cho mục tiêu chia tải và chịu lỗi.
b/ Schedule: chạy theo lịch đặt sẵn, khi chạy sẽ chiếm 100% bandwidth.
Dùng cơ sở này cho mục tiêu tập hợp dữ liệu( vd: cứ 10h tối là các spoke sẽ tập hợp dữ liệu về Hub)

Triển khai:
2012may1: DC đóng vai trò vừa namespace server vừa là file server.
2012may2: Member computer vừa namespace server vừa là file server.

Bước 1: Trên Namespace Server và File Server 
Mở Server Manager ->Manage -> Add Roles and Features -> Next đến
Select Server  Roles: Bung File and Storage Service  ->  Check vào DFS Namespace và DFS Replication
( Nếu File Server và Namespace Server riêng thì File Server cài DFS Replication, Namespace Server cài DFS Namespace)
-> Next
DFS 1
Add Roles DFS
Next mặc định và Install
DFS 2
Làm tương tự cho 2012may2

Bước 2: Thực hiện trên File Server
Trên File Server:  tạo và phân quyền các thư mục chứa dữ liệu
Trên máy 2012may1: tạo folder Data chứa 2  folder con (subfolder) là NhanSu(xóa group Users, Group Nhansu: Modify)  và KeToan (xóa group Users, Group KeToan: Modify)
Trên máy 2012may2: tạo folder Data.bak chứa 2 subfolder: NhanSu.bak và KeToan.bak, phân quyền như trên.
Lưu ý: 2012may2 có thể đặt tên folder giống như 2012may1 (tùy ý đặt tên).

Bước 3 : Thực hiện trên Namespace Server
Tạo Namespace (khi tạo namespace phải chỉ định Namespace server)
Kiểm tra DFS Namespace service và DFS Replication service trên 2 máy phải ở trạng thái “ running”.
Run -> services.msc
DFS 3
Vào Server Manager -> Tools -> DFS Management
DFS 4
Chọn vào Namespace -> New Namespace
Namespace Server
Server: chỉ định namespace server, ta browse về máy 2012may1
DFS 5

Namespace Name and Settings
Name: DataCongTy
Chọn Edit Setting:
DFS 6
Ta thấy  cấu trúc namespace “ DataCongTy” được lưu trong folder DFS root.
Share folder permissions: phân quyền trên cấu trúc namespace: ta chọn cái thứ 3
Administrators have full access, other users have read-only permissions: admin có toàn quyền, user chỉ cần đọc được cấu trúc là có thể truy cập được, không cần đụng vào cấu trúc namespace làm gì .
Hoặc ta co thể chọn use custom permissions: để phân quyền tùy nhu cầu -> NEXT
Namespace Type: Domain-based namespace: (vì đang làm trên môi trường domain)
DFS 7

Ta NEXT và Create
DFS 8

Sau đó bung Namespaces -> hiện ra đường dẫn luận lý: \\tuhocmang.local\DataCongTy. Đường dẫn này chưa chứa dữ liệu nào. Đây mới chỉ là yếu tố luận lý
DFS 9

Chọn vào đường dẫn -> Add Namespace Server
DFS 10
Ta Browse về server 2012may2 ( cấu hình 2 namespace để đảm bảo 1 trong 2 namespace bị failed thì người dùng vẫn có thể truy xuất dữ liệu)
DFS 11


Phần Edit Settings ta cũng phân quyền như trên -> OK
DFS 12

DFS 13

Qua tab Namespace Server, xuất hiện 2 Namespace Server
DFS 14

( 2 Namespace server sẽ tự đồng bộ namespace)
Bước 4: Tại File Server tạo Replicaiton group
Mở cửa sổ DFS Management
Chọn Namespaces -> Add Namespace to display:  để đồng bộ với namespace server khác (nếu chưa tự đồng bộ) -> Browse về 2012may2
DFS 15
Chọn Replication -> New Replication Group
DFS 16

Replication Group Type:
Do ta đang muốn cấu hình file server hướng đến mục tiêu thứ 1: chia tải và chịu lỗi nên chọn Multipurpose replicatiton group -> Next
Name and Domain:
Name of replication: DongBoDaTaCongTy -> Next
DFS 17

Replication Group Member:
Add các máy làm File Server: ta add 2012may1 và 2012may2 -> Next
DFS 18

Topology Selection: Chọn Full Mesh -> Next
DFS 19

Replication Group Schedule and Bandwidth (đã nói ở đầu bài). Ta chọn 64MB
DFS 20

Primary Member: chọn 2012may1
DFS 21
Folders to Replicate: Đồng bộ những folder nào
DFS 22
Chọn Add
DFS 33
Local Path of folder to replicate: ta Browse về folder KeToan
Folder KeToan ta đã phân quyền NTFS rồi (mặc định là giữ lại các quyền NTFS trên folder )
Nếu muốn chỉnh quyền lại thì ta chọn Permissions
Ta thấy rằng, ta cần đồng bộ thêm folder NhanSu. Nhưng ta chỉ cần add 1 folder KeToan thôi. Các folder còn lại thì nên Add sau.
-> Next.
Local Path Of KeToan on Other Member: Chỉ định folder sẽ đồng bộ với folder KeToan. Ta muốn folder KeToan trên 2012may1 sẽ đồng bộ với folder KeToan.bak trên 2012may2
DFS 24
Chọn Edit ->Enable ->Browse về folder KeToan.bak
DFS 25

Make the selected replicated folder on this member read-only: Nếu check vào folder này thì permission trên folder KeToan.bak sẽ như folder KeToan ( quyền sẽ giống Primary Server)
Ở bước này, hệ thống chỉ cho ta chọn 1 folder, đó là lý do tại sao Local Path of folder to replicate ta chỉ chỉ định 1 folder trên 2012may1.
Còn việc đồng bộ giữa NhanSu trên 2012may1 và NhanSu.bak trên 2012may2 ta sẽ làm sau.
Ta Next và Create
DFS 26
Ta tiếp tục chọn New Replicated Folder để cấu hình cho folder NhanSu đồng bộ với folder NhanSu.bak.
Bước 5: Share and Publish
Trên 2012may1
Mở DFS Management -> Namespace -> phải chuột \\tuhocmang.local\DataCongTy -> New Folder
DFS 27

Name: Data
Folder Target: Không khai báo gì cả. -> OK
DFS 28

Data: là 1 thư mục mang tính cấu trúc (Loại 1). Bây giờ ta đi share và publish.
Chọn Replication -> Add Replication to Display -> Chọn DongBoDataCongTy
DFS 29

Chọn vào DongBoDataCongTy -> Bên phải chọn Tab Replicated Folder -> Phải chuột KeToan -> Share and Publish in Namespace
DFS 30


Publishing Method: Chọn Share and publish the replicated folder in a namespace -> Next
DFS 31

Share Replicated Folder: chọn 2012may1
DFS 32
Chọn Edit
DFS 33
Nó yêu cầu ta share folder KeToan và share với quyền gì. Ta chọn Edit Permission -> cho everyone Full control (vì ta đã phân quyền NTFS rồi)
Sau đó chọn tiếp 2012may2 -> Edit
New: share name đặt là KeToan.bak cho dễ quản lý (share name đặt giống 2012may1 khó quản lý)
DFS 34

Namespace Path: Ta sẽ publish folder này ở cấp nào:
DFS 35
Ta Browse về Data => đường dẫn để truy xuất dữ liệu sẽ bắt đầu bằng: \\tuhocmang.local\DataCongTy\Data
New folder name: có thể tạo tên mới để che cấu trúc folder đi ( thay vì mặc định là KeToan)
-> Next
DFS 36
Ta thấy KeToan đại diện cho KeToan và KeToan.bak
-> Share
Nếu muốn thay đổi đường dẫn ta vào Data -> KeToan -> Move Folder để đổi tên lại. ( giả sử đổi lại như hình).
DFS 37

Làm tương tự cho folder NhanSu (Share and Publish)
DFS 38

TEST
+ KT1 truy cập:
\\tuhocmang.local\DataCongTy\Data\KeToan -> tạo folder KT1
Trên folder KeToan và KeToan.bak xuất hiện folder KT1 ( đồng bộ)
+ Disable card mạng 2012may2, KT1 truy cập đường dẫn bình thường ( Chịu lỗi)
KT1 xóa folder KT1 -> Enable card mạng 2012may2 -> vào KeToan.bak thấy mất folder KT1 (đồng bộ)
Lưu ý:
+ Primary Server và Secondary Server là như nhau, chỉ khác là đường dẫn mặc định lấy tên folder của primary Server.
+ DFS Replication chỉ làm việc trên Domain.
+ DFS xây dựng trên môi trường workgroup chỉ hỗ trợ Load Balacing, không hỗ trợ Failover.
1 số link tham khảo:
http://msdn.microsoft.com/it-it/library/cc781582(v=ws.10).aspx
http://blogs.technet.com/b/askds/archive/2011/09/16/active-directory-site-topology-not-just-for-dcs.aspx
http://technet.microsoft.com/en-us/library/cc784885(v=ws.10).aspx
http://mizitechinfo.wordpress.com/category/windows-server-2012-r2/
http://blogs.technet.com/b/filecab/archive/2005/12/06/415625.aspx :
Mình xin kết thúc bài DFS ở đây. Cảm ơn các bạn đã theo dõi.

Saturday, February 22, 2014

Automatic Virtual Machine Activation Step by Step


What is AVMA?
Automatic Virtual Machine Activation is a new Windows feature added in Windows Server 2012R2 microsoft-end-user-license-agreement-397x300that enables you to activate your Windows VMs without using a KMS server or even a network connection. As you spin up new virtual machines they will activate against the host Hyper-v server. This activation only lasts 7 days and then it needs to renew it’s activation. This is perfect for your Windows Datacenter Hyper-v hosts because you can
Two features of AVMA that no other activation method offers are:
  1. The ability to automatically activate virtual machines without a network connection
  2. Track virtual machine licenses from the host virtualization server, without requiring any access rights on the virtualized machine
(Other options for activation are: KMS server, MAK key, AD-based Activation)
How Does AVMA work?
Automatic Virtual Machine Activation requires a Hyper-v host server running Windows Server 2012 R2 Datacenter and it must be activated. The Virtual Machines must be 2012R2 or above to activate under AVMA. This includes 2012R2 Datacenter, Standard, and Essentials.
The guest VMs must have an AVMA product key configured on them. See the table blow for the key.
Windows Server 2012 R2 AVMA keys:
Edition AVMA key
Datacenter Y4TGP-NPTV9-HTC2H-7MGQ3-DV4TW
Standard DBGBW-NPF86-BJVTX-K3WKJ-MTB6V
Essentials K2XGM-NMBT3-2R6Q8-WF2FK-P36R2
* Licenses above were taken from http://technet.microsoft.com/en-us/library/dn303421.aspx
These keys can be installed during the install or installed at a later time.
The last piece of this is how the virtual machine talks to it’s Hyper host to get activated. The channel it uses is the “Data Exchange” that the para-virtualization drivers provide. This is a per VM setting and is enabled by default. You can verify that it is enabled by going into a VMs settings and then selecting the Integration Services. Make sure “Data Exchange” is checked.
AVMA1
AVMA also provides real-time reporting on usage and historical data on the license state of the virtual machine. This data is stored and available on the virtualization host server. There is no need to have any access or rights to the VMs on that server to access this information.
Step by Step directions to implement AVMA:
To use AVMA is easy just follow these 4 steps to virtual bliss:
  1. Install Server 2012R2 Datacenter
  2. Activate the server
  3. Add the Hyper-v Role
  4. Install a 2012R2 Virtual Machine and assign an AVMA key
If your virtual machine needs a key or already has a different key and you would like to give it an AVMA key there are a couple ways to achieve that. Here are two:
Using the GUI – Start the File Manager and Right click on “This PC”. From that dropdown list select “Properties”.
image
You will then get the System Screen. From here you select the Change Product key at the bottom right of the window. Put in one of the keys in the above table.
image

Another way to change the product key is to do it from a command prompt or script. This will need to run with administrative privileges.
Steps to Set the Product key from a command Prompt:
  • Click on the Start Button and type “CMD”   — (Welcome back Start Button)
  • Right click on the Command Prompt and select “Run as administrator” image
  • In the command window run the command slmgr /ipk <AVMA_key>
    Command in the example below:
    slmgr /ipk Y4TGP-NPTV9-HTC2H-7MGQ3-DV4TW image
Hope you found this fun and informative! –Brian Hot smile

This post is part of a series of posts by the US IT Pro Evangelist team. In this series we cover, Why Windows Server 2012 R2 is important, how to deploy, manage, configure any number of components in Windows Server 2012 R2. 
This series is deep technical content with lots of How To’s and Step-By-Step instructions. You will learn about storage, cloud integration, RDS, VDI, Hyper-V, virtualization, deduplication, Hyper-v replica, DNS, AD, DHCP, high availability, SMB, backup, PowerShell and much, much more! – See more at: http://itproguru.com/expert/2013/10/windows-server-2012-r2-launch-blog-series-why-win2012r2/

Wednesday, September 11, 2013

Step-By-Step: Installing Windows Server 2012 RTM from thumb-drive creating a “New” bootable Virtual Hard Disk


Here are my latest notes for boot to .VHD without messing up your bare metal.
This process can be used for Windows Server 2012 or Windows 8.
Here’s what you need to have in your IT Toolbox for this exercise.
-          USB Drive (4GB or larger)
-          .ISO File of Windows Server 2012 RTM Eval 180-Days
-          The Windows 7 USB/DVD Download
Native VHD boot is supported only by Windows 7, and it is restricted to the following editions:
    • Windows® 7 Enterprise
    • Windows® 7 Ultimate
    • Not Professional My understanding of this is that Native VHD Boot of the Windows 7 OS is only supported on Enterprise and Ultimate.  However, using BCDBOOT, I’ve seen other OS’s booted on a PC that originally had Windows 7 Home, Pro, Enterprise and Ultimate installed as its native OS. Thanks Keith.
    http://technet.microsoft.com/en-us/library/dd799282(v=WS.10).aspx
Get your Windows Server 2012 RTM Eval and Windows 8 Eval .ISO downloads at: http://aka.ms/msproducts


Check your BIOS – Boot and do an F2 – or whatever your BIO enablement is (F10, ThinkVantage Blue Button or whatever to boot into your BIOS). 
Check the following:
o    Enable “Virtualization Technology [VT]” (Processor)
o    Enable “Data Execution Prevention [DEP]” (Security)
o    Enable “Second Level Address Translation [SLAT]”
o    Change boot sequence to allow media (USB Drive)
Get a USB Thumb Drive. 4GB – 8GB (Note: 4GB will work for .ISO boot as the files are 3.44GB.  The drive will be formatted!)
You can use the GUI (Graphical User Interface)   Windows 7 USB/DVD Download Tool that is in the parking lot of the This is a great tool at the Microsoft Store location at: http://images2.store.microsoft.com/prod/clustera/framework/w7udt/1.0/en-us/Windows7-USB-DVD-tool.exe
Or you can do the CUI (Character User Interface) later in the post.
It is all Step-By-Step.  Want to have it easy? 
Start the USB Boot Tool -
image
Choose the .ISO
image
Choose the Media – USB or DVD -  It’s that Easy
image
Insert USB Device
image
Create the USB Bootable Device
image
If you want to do the CUI for the USB Thumb Drive which ends with the same results, do the following:
Open up – Command Prompt
diskpart - enter
list disk enter. Find your USB drive letter.
(CAUTION: Be sure to select the CORRECT DISK before formatting)
select disk 1  (Replace disk 1 with your disk number)
clean
Sample below:
image
create partition primary
select partition 1
active
format fs=ntfs
(Format process may take a couple of minutes)
assign
exit
Sample below:
image
Copy the Windows files from the .ISO to your USB drive with Windows Server 2012 90-Evaluation downloaded from http://aka.ms/msproducts
Sample below:
image
image
Make sure your computer BIOS is set to boot to USB
Boot from USB (it will do this automatically if you build the USB to be bootable above!)
CAUTION!  If you want to keep you OS and dual boot, do not delete your primary on System Partition on Drive 0 and OS partition on Drive 1.
Create a new partition for your boot to VHD.
To to this, go through the Windows Server 2012 install until you see the partitions screen.
Hit SHIFT + F10 to open a command prompt window,  find the installation drive (dir c:, dir d:, dir e: and keep this drive) usually c:
DISKPART
create vdisk file=e:\BootDemo.vhd type=expandable maximum=40000
attach vdisk


Hit REFRESH to see the partition, to see a video go to my buddy’s Dan Stolt’s at http://aka.ms/Boot2VHD
Continue and the install will begin and start loading the files.
FYI - Note:   Windows Product Key is not required for this 180-Day Evaluation Edition. You can always add your Product Key in later with “Activate with a new key”.
image
This is what you will see on the desktop on first boot.
image
Take the defaults on the Language screen Click Next
Click Install now on the install screen
If Installing Windows Server 2012 Datacenter (Server with a GUI) x64 –
Note: Click the 4th line item for the GUI.
image
 The default install is now Server Core click Next
Read License Agreement, Click checkbox “I accept the license terms” then Click Next
The disk you are using should be listed. If not, you will need to Load driver. Select the disk you will be installing on. Select the 39.9 partition want to change drive options Click Next
It will then start copying files. This will take a while (could be 20 minutes or so depending on hardware performance)
It will reboot a couple times (automatically) after the first reboot it will no longer be running off of the USB (if you see the Install screen, take out the USB, cancel the Install and Reboot.
The install for the Boot to VHD routine will continue….
In the Password box enter a new password for this computer. It must meet complexity requirements. Re-enter the password in the second password box then click Finish
If you are using Windows Server 2012 Press Ctrl-Alt-Delete at the same time to get the login screen
Enter password and press <ENTER>
If you are using Windows Server 2012 - The Desktop will be displayed and Server Manager will be opened automatically.
If you are using Windows Server 2012 Press Windows Key on the keyboard will bring up the start screen (formerly known as Start Menu)
If you Right-Click on Computer you will see the new right-click menu is on the bottom of the screen instead of in a dropdown box. Select Properties
We can now change the computer name by clicking on Change Settings
If you are using Windows Server 2012 Type new computer name you would like to use and click OK
Click OK on the information box
Click OK to allow a restart
Then click Restart Now on the final dialog box.
When the computer restarts it will have the new name,
Note: You will see the dual boot to boot to .VHD which is usually your Volume 2, and the NATIVE operating system is usually Volume 1.

Deleting the Boot to the Virtual Hard Disk Scenario
To get your machine back to boot off of the NATIVE operating system (ie. Volume 1) Hit the Windows Key + C then go to SEARCH, or click the lower right-hand corner and go to SEARCH and type in MSCONFIG (under APPS).
In MSCONFIG, go to the BOOT tab and Delete the one you want to disguard but keep the Current OS as that will be your bare metal installation of Windows.
Click “Ok”.
To delete the .VHD and dual boot go to Desktop and Windows Explorer and delete the BootDemo.vhd file, Click Continue in the message box, then empty the Recycling Bin.
If you have issues- boot to the Native Operating System DVD and use the System Repair in Windows.

 
Design by IT Manager | Bloggerized by Themes For IT Managers | MIS-DUONG