在公有云AZURE上部署私有云AZUREPACK以及WEBSITE CLOUD(二)

时间:2023-03-09 09:03:36
在公有云AZURE上部署私有云AZUREPACK以及WEBSITE CLOUD(二)

前言

(二)建立虚拟网络环境,以及域控和DNS服务器

  1. 1搭建虚拟网络环境

在Azure上创建虚拟网络。本例选择的是东南亚数据中心。后面在创建虚机的时候,也选择这个数据中心。

VNet Name:     waplab@sea2016

IP Address count :     128,

IP Range :         10.0.0.0 – 10.0.0.127

* sea : South East Asia, 东南亚数据中心

在公有云AZURE上部署私有云AZUREPACK以及WEBSITE CLOUD(二)

并创建4个子网

  1. CTRL 子网: 32 个IP,IP范围 10.0.0.0 – 10.0.0.31, 用于域控、DNS、SQL server等核心服务器。其中用于DNS的服务器,在后面创建的时候,需要指定其静态IP地址,本例中为10.0.0.8.
  2. WAP子网:32个IP, IP范围 10.0.0.32 – 10.0.0.63, 用于Windows Azure Pack的服务器群集安装。虽然在本例中,因为使用了Standalone模式,只需要一台服务器, 但是正式的Windows Azure Pack 是由多个不同的服务组成,且每个服务都需要考虑高可用性冗余,所以需要的机器远不止一台。具体请参考MSDN上WAP的安装
  3. WAP Site子网,32个IP, IP范围 10.0.0.64 – 10.0.0.95,用于Website Service的服务器群集安装。 在不考虑高可用性的时候, Website Service的6个Role, 每个Role至少一台。Web Worker Role每个Mode各准备1台,即需要另3台。
  4. Reserved子网,32个IP。暂时未使用。

虚拟网络建好后, 再添加自定义的DNS服务器地址, 即10.0.0.8。后文中会具体说明该DNS服务器的安装和配置。

关于域名解析: Azure defaults to using its own name resolution service. The default name resolution in Azure works well if you only need name resolution between virtual machines within the same cloud service

 

Azure-provided name resolution

Along with resolution of public DNS names, Azure provides internal name resolution for VMs and role instances that reside within the same virtual network or cloud service. VMs/instances in a cloud service share the same DNS suffix (so the hostname alone is sufficient) but in classic virtual networks different cloud services have different DNS suffixes so the FQDN is needed to resolve names between different cloud services. In ARM-based virtual networks, the DNS suffix is consistent across the virtual network (so the FQDN is not needed) and DNS names can be assigned to both NICs and VMs. Although Azure-provided name resolution does not require any configuration, it is not the appropriate choice for all deployment scenarios, as seen on the table above

Reference from:

https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-name-resolution-for-vms-and-role-instances/#azure-provided-name-resolution

 

2搭建域控、ad及DNS服务器

准备一台虚机来作为域控服务器;节省起见,同时也作为DNS服务器, 采用的配置如下

A2: 2 Core 4GB Memory

使用如下Powershell脚本

#install DomainControl and DNS

 

$imgName="a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-20160126-en.us-127GB.vhd"

$vnetName="waplab@sea2016"
# @SouthEast Asia

$wapLabSubNet="ctrl"
#{ctrl, wapsubnet, sitesubnet, reservedsubnet}

 

$cloudServiceName
=
"wapLabCloudService2016Feb"

$affinityGroupName
=
"southeastAsiaGroup"

$admin="vmadmin"

$pwd
=
"[your password]"

 

$sizeLarge
=
"Large"
#Allowed values are 'ExtraSmall,Small,Medium,Large,ExtraLarge,A5,A6,A7,A8,A9

$sizeMedium
=
"Medium"

$sizeSmall
=
"Small"

 

$vmDCName
=
"waplabDC"

 

 

$affGroupObj
=
Get-AzureAffinityGroup
-Name
$affinityGroupName
-ErrorAction
Ignore

 

if(!$affGroupObj)

{

New-AzureAffinityGroup
-Name
$affinityGroupName
-Location
$location

}

 

# DC

$vmDC
=
New-AzureVMConfig
-Name
$vmDCName
-InstanceSize
$sizeMedium
-ImageName
$imgName

$vmDC
|
Add-AzureProvisioningConfig
–§CWindows
-AdminUsername
$admin
-Password
$pwd

$vmDC
|
Set-AzureSubnet
-SubnetNames
$wapLabSubNet

$vmDC
|
Set-AzureStaticVNetIP
-IPAddress
"10.0.0.8"
# 指定静态IP"10.0.0.8"

$vmDC
|
New-AzureVM
-ServiceName
$cloudServiceName
-AffinityGroup
$affinityGroupName
-vNetName
$vnetName

 

由于该服务器同时还作为DNS服务器, 需要固定的IP(内网IP即可),所以在Provision(供给)的时候,需要指定其静态IP。如果供给的时候没有指定,也可以通过Update-AzureVM命令来更新。

虽然指定了静态IP,但是从虚机的网络配置中(网卡->属性->IP v4),看到的还是动态分配IP;同时也DNS服务器也不是指定的。这说明IP和DNS服务器都是Azure的虚拟网络来设定的。

如果前面提到的虚拟网络中的DNS服务器是在虚机创建后面才配置的,那么虚机需要重启才能应用该DNS服务。

关于如何获得镜像的名称, 请参考我的另一篇随笔

在Azure上的VM镜像库中找到想要的镜像

 

3配置域控与DNS服务

 

现在服务器角色,即AD Domain Service 和 DNS服务

 

(此图不对,重新截图)

设置根域名为     waplab.com

NetBios :     waplab

在公有云AZURE上部署私有云AZUREPACK以及WEBSITE CLOUD(二)

域控的具体安装过程, 可以参考文章http://social.technet.microsoft.com/wiki/contents/articles/12370.windows-server-2012-set-up-your-first-domain-controller-step-by-step.aspx

 

安装完成后, 打开DNS的Console

在公有云AZURE上部署私有云AZUREPACK以及WEBSITE CLOUD(二)

可以看到默认已有的waplab的正向解析。

尝试Ping

在公有云AZURE上部署私有云AZUREPACK以及WEBSITE CLOUD(二)

指向域控当前的服务器

 

4添加域账号和组织单元(OU)

域控安装完成后, 当前使用的vmadmin已经变成了域账户,即waplab\vmadmin。为了管理方便,可以再添加一个域管理员账户, 比如waplab\domainadmin.

为了方便后面使用组织策略, 可以添加一个组织单元(OU),并且在后面创建虚机的时候, 将加域的虚机都放入到这个OU中

Create OU: AzureVMs

后面的服务器都需要加入到域中。可以在创建的时候, 使用Add-AzureProvisioningConfig 命令来指定加域的相关信息。详见后面章节。

5配置DNS解析

创建DNS服务器,并且添加如下的域名解析(A记录)

Host name 

Record type

IP Address for 

* 

C Name

Front End Server(s) 

*.scm 

C Name

Front End Server(s) 

ftp 

C Name

Publishing Server(s) 

publish 

C Name

Publishing Server(s)