資源編排ROS支持在模板中定義所需的阿里云資源(例如ECS實例、RDS數據庫實例)、資源間的依賴關系等。ROS的編排引擎將根據模板自動完成所有資源的創建和配置,實現自動化部署及運維。本文介紹如何通過OSS以及ROS服務快速創建Sharepoint 2013。
本文示例由阿里云用戶肖伊提供,僅供參考。
前提條件
已創建讀寫權限ACL為私有的Bucket。關于創建Bucket的具體步驟,請參見創建存儲空間。
已下載sharepoint.exe。
步驟一:在Bucket中上傳sharepoint.exe文件
步驟二:通過ROS新建資源棧
選擇模板。
登錄資源編排控制臺。
在左側導航欄,單擊資源棧。
在頁面左上角的地域下拉列表,選擇華東1(杭州)。
在資源棧列表頁面,單擊創建資源棧,然后在下拉列表中選擇使用ROS。
在選擇模板頁面,指定模板為選擇已有模板、模板錄入方式選擇輸入模板、在ROS模板內容的JSON頁簽輸入以下內容,然后單擊下一步。
{ "ROSTemplateFormatVersion": "2015-09-01", "Description": "One simple ECS instance with SharePoint Foundation2013, default image is win2008r2_sp1_x64_ent_zh-cn_40G_alibase_20200116.vhd,The user needs to specify the instance type ", "Parameters": { "VpcCidrBlock": { "Type": "String", "Description": { "en": "The IP address range of the VPC in the CIDR Block form; <br>you can use the following IP address ranges: <br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>", "zh-cn": "專有網絡IP地址段范圍,<br>您可以使用以下的IP地址段:<br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>" }, "AllowedValues": [ "192.168.0.0/16", "172.16.0.0/12", "10.0.0.0/8" ], "Label": { "en": "VPC CIDR Block", "zh-cn": "專有網絡網段" }, "Default": "192.168.0.0/16" }, "VSwitchCidrBlock": { "Type": "String", "Description": { "zh-cn": "創建的虛擬交換機的子網,必須是所屬專有網絡的子網段,并且沒有被其他交換機占用。", "en": "Subnet of the created virtual switch,must be a sub-network segment of the proprietary network and is not occupied by other VSwitches." }, "Label": { "zh-cn": "交換機網段", "en": "VSwitch CIDR Block" }, "Default": "192.168.0.0/16" }, "ZoneId": { "Type": "String", "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId", "Description": { "en": "Availability zone ID,<br><b>note: <font color='blue'>Before selecting, please confirm that the Availability Zone supports the specification of creating ECS resources</font></b>", "zh-cn": "可用區ID,<br><b>注: <font color='blue'>選擇可用區前請確認該可用區是否支持創建ECS資源的規格</font></b>" }, "Label": { "zh-cn": "交換機可用區", "en": "VSwitch Available Zone" } }, "SharePointDownloadPath": { "Label": { "zh-cn": "SharePoint鏡像下載路徑", "en": "SharePoint Image Download Path" }, "Type": "String", "Description": { "zh-cn": "SharePoint Foundation2013鏡像下載路徑,詳見: <a target='_blank'><b><font color='blue'>SharePoint Foundation2013鏡像下載路徑</b></font></a>", "en": "SharePoint Foundation2013 image download path, see detail: <a target='_blank'><b><font color='blue'>SharePoint Foundation2013 image download path</b></font></a>" } }, "ImageId": { "Default": "win2008r2_sp1_x64_ent_zh-cn_40G_alibase_20200116.vhd", "Label": { "zh-cn": "鏡像", "en": "Image ID" }, "Type": "String", "Description": { "zh-cn": "鏡像ID,關于SharePoint Foundation2013系統要求,詳見: <a target='_blank'><b><font color='blue'>SharePoint Foundation2013系統要求</b></font></a>", "en": "Image ID, About SharePoint Foundation2013 system requirements, see detail: <a target='_blank'><b><font color='blue'>SharePoint Foundation2013 system requirements</b></font></a>" } }, "InstanceType": { "Type": "String", "Description": { "zh-cn": "填寫VSwitch可用區下可使用的規格;<br>通用規格:<font color='red'><b>ecs.c5.large</b></font><br>注:可用區可能不支持通用規格<br>規格詳見:<a href='http://bestwisewords.com/document_detail/25378.html' target='_blank'><b><font color='blue'>實例規格族</font></a></b>", "en": "Fill in the specifications that can be used under the VSwitch availability zone;</b></font><br>general specifications:<font color='red'><b>ecs.c5.large</b></font><br>note: a few zones do not support general specifications<br>see detail: <a target='_blank'><b><font color='blue'>Instance Specification Family</font></a></b>" }, "Label": { "zh-cn": "實例規格", "en": "Instance Type" }, "AssociationProperty": "ALIYUN::ECS::Instance::InstanceType", "AssociationPropertyMetadata": { "ZoneId": "ZoneId" } }, "Password": { "NoEcho": true, "Type": "String", "Description": { "en": "Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).", "zh-cn": "服務器登錄密碼,長度為8~30個字符,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)。" }, "AllowedPattern": "[0-9A-Za-z\\_\\-\\&:;'<>,=%`~!@#\\(\\)\\$\\^\\*\\+\\|\\{\\}\\[\\]\\.\\?\\/]+$", "Label": { "zh-cn": "實例密碼", "en": "Instance Password" }, "ConstraintDescription": { "en": "Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).", "zh-cn": "長度為8~30個字符,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)。" }, "MinLength": 8, "MaxLength": 30 } }, "Metadata": { "ALIYUN::ROS::Interface": { "ParameterGroups": [ { "Parameters": [ "VpcCidrBlock", "VSwitchCidrBlock" ], "Label": { "default": "VPC" } }, { "Parameters": [ "ZoneId", "ImageId", "SharePointDownloadPath", "InstanceType", "Password" ], "Label": { "default": "ECS" } } ], "TemplateTags": [ "acs:example:Windows應用服務:ROS_OOS創建SharePoint2013的windows實例" ] } }, "Resources": { "RosWaitCondition": { "Type": "ALIYUN::ROS::WaitCondition", "Properties": { "Timeout": 2700, "Count": 2, "Handle": { "Ref": "RosWaitConditionHandle" } }, "Metadata": { "ALIYUN::ROS::Designer": { "id": "47058b03-d345-4071-bcdb-9bc2888899be" } } }, "EcsVswitch": { "Type": "ALIYUN::ECS::VSwitch", "Properties": { "VpcId": { "Ref": "EcsVpc" }, "ZoneId": { "Ref": "ZoneId" }, "CidrBlock": { "Ref": "VSwitchCidrBlock" } }, "Metadata": { "ALIYUN::ROS::Designer": { "id": "3f1d6b20-25eb-4a1c-a40f-1f764b157bd6" } } }, "SharePointServer": { "Type": "ALIYUN::ECS::Instance", "Properties": { "VpcId": { "Ref": "EcsVpc" }, "UserData": { "Fn::Replace": [ { "ros-notify": { "Fn::GetAtt": [ "RosWaitConditionHandle", "PowerShellCurlCli" ] } }, { "Fn::Join": [ "", [ "[powershell]\r\n", "New-Item -Path \"C:\\Install_dir\" -Force -type directory \r\n", "$ossName = 'ros-template-resources' \r\n", "$client = new-object System.Net.WebClient \r\n", "$client.DownloadFile(\"", { "Ref": "SharePointDownloadPath" }, "\", 'C:\\Install_dir\\SharePoint.exe') \r\n", "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/AppFabric1.1-RTM-KB2671763-x64-ENU.exe\", 'C:\\Install_dir\\AppFabric1.1-RTM-KB2671763-x64-ENU.exe')\r\n", "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/MicrosoftIdentityExtensions-64.msi\", 'C:\\Install_dir\\MicrosoftIdentityExtensions-64.msi')\r\n", "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/setup_msipc_x64.msi\", 'C:\\Install_dir\\setup_msipc_x64.msi')\r\n", "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/sqlncli.msi\", 'C:\\Install_dir\\sqlncli.msi')\r\n", "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/Synchronization.msi\", 'C:\\Install_dir\\Synchronization.msi')\r\n", "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/WcfDataServices.exe\", 'C:\\Install_dir\\WcfDataServices.exe')\r\n", "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/Windows6.1-KB974405-x64.msu\", 'C:\\Install_dir\\Windows6.1-KB974405-x64.msu')\r\n", "$client.DownloadFile(\"https://$ossName.oss-cn-beijing.aliyuncs.com/SharePoint/WindowsServerAppFabricSetup_x64.exe\", 'C:\\Install_dir\\WindowsServerAppFabricSetup_x64.exe')\r\n", "cd C:\\Install_dir \r\n", "New-Item \"install_sharepoint.bat\" -type File \r\n", "Add-Content install_sharepoint.bat \"C:\" \r\n", "Add-Content install_sharepoint.bat 'powershell.exe C:\\Install_dir\\Install_SharePoint.ps1' \r\n", "New-Item \"Install_SharePoint.ps1\" -type File \r\n", "Add-Content Install_SharePoint.ps1 'if(Test-Path \"C:\\Install_dir\\finished.log\"){' \r\n", "Add-Content Install_SharePoint.ps1 \"cd C:\\Install_dir \" \r\n", "Add-Content Install_SharePoint.ps1 \"}else{ \" \r\n", "Add-Content Install_SharePoint.ps1 'Start-Process C:\\Install_dir\\2013\\Setup.exe -args \"/config C:\\Install_dir\\2013\\Files\\SetupSilent\\config.xml\" -Wait'\r\n", "Add-Content Install_SharePoint.ps1 'cd C:\\Install_dir'\r\n", "Add-Content Install_SharePoint.ps1 'New-Item \"finish.log\" -type File'\r\n", "Add-Content Install_SharePoint.ps1 'Remove-Item \"C:\\Install_dir\\SharePoint.exe\"' \r\n", "Add-Content Install_SharePoint.ps1 'Remove-Item \"C:\\Install_dir\\2013\\*\" -recurse' \r\n", "Add-Content Install_SharePoint.ps1 'schtasks /delete /TN \"install_sharepoint\" /f'\r\n", "Add-Content Install_SharePoint.ps1 'ros-notify'\r\n", "Add-Content Install_SharePoint.ps1 \"}\" \r\n", "Start-Process C:\\Install_dir\\SharePoint.exe -args \"/extract:C:\\Install_dir\\2013 /quiet\" -Wait \r\n", "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args \"/continue /unattended\" -Wait \r\n", "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args \"/SQLNCli:C:\\Install_dir\\sqlncli.msi /continue /unattended\" -Wait\r\n", "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args \"/IDFX:C:\\Install_dir\\Windows6.1-KB974405-x64.msu /continue /unattended\" -Wait\r\n", "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args \"/Sync:C:\\Install_dir\\Synchronization.msi /continue /unattended\" -Wait\r\n", "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args \"/AppFabric:C:\\Install_dir\\WindowsServerAppFabricSetup_x64.exe /continue /unattended\" -Wait \r\n", "Start-Process C:\\Install_dir\\MicrosoftIdentityExtensions-64.msi -args \"/quiet\" -Wait \r\n", "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args \"/continue /unattended\" -Wait \r\n", "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args \"/WCFDataServices:C:\\Install_dir\\WcfDataServices.exe /continue /unattended\" -Wait \r\n", "Start-Process C:\\Install_dir\\2013\\prerequisiteinstaller.exe -args \"/KB2671763:C:\\Install_dir\\AppFabric1.1-RTM-KB2671763-x64-ENU.exe /continue /unattended\" -Wait\r\n", "schtasks /create /TN \"install_sharepoint\" /RU administrator /RP \"", { "Ref": "Password" }, "\" /SC ONSTART /TR \"C:\\Install_dir\\install_sharepoint.bat\" \r\n", "ros-notify \r\n", "shutdown /r /f /t 1 \r\n" ] ] } ] }, "SecurityGroupId": { "Ref": "EcsSecurityGroup" }, "VSwitchId": { "Ref": "EcsVswitch" }, "ImageId": { "Ref": "ImageId" }, "InstanceType": { "Ref": "InstanceType" }, "Password": { "Ref": "Password" } }, "Metadata": { "ALIYUN::ROS::Designer": { "id": "62ed3480-152b-40d3-946d-4d19c0de7530" } } }, "EcsVpc": { "Type": "ALIYUN::ECS::VPC", "Properties": { "CidrBlock": { "Ref": "VpcCidrBlock" }, "VpcName": "Vpc-sharepoint" }, "Metadata": { "ALIYUN::ROS::Designer": { "id": "4dfdcadf-d55e-4085-af95-79d40005c3da" } } }, "EcsSecurityGroup": { "Type": "ALIYUN::ECS::SecurityGroup", "Properties": { "SecurityGroupIngress": [ { "Priority": 1, "PortRange": "3389/3389", "NicType": "intranet", "SourceCidrIp": "0.0.0.0/0", "IpProtocol": "tcp" } ], "VpcId": { "Ref": "EcsVpc" } }, "Metadata": { "ALIYUN::ROS::Designer": { "id": "f1c13fc6-e74d-477c-be14-9e24fd583b55" } } }, "RosWaitConditionHandle": { "Type": "ALIYUN::ROS::WaitConditionHandle", "Metadata": { "ALIYUN::ROS::Designer": { "id": "d3d24118-a044-4f1d-9684-758480e50a31" } } } }, "Outputs": { "InstanceId": { "Value": { "Fn::GetAtt": [ "SharePointServer", "InstanceId" ] } }, "PublicIp": { "Value": { "Fn::GetAtt": [ "SharePointServer", "PublicIp" ] } }, "SecurityGroupId": { "Value": { "Fn::GetAtt": [ "EcsSecurityGroup", "SecurityGroupId" ] } }, "VpcName": { "Value": { "Fn::GetAtt": [ "EcsVpc", "VpcId" ] } } } }
配置模板。
在配置模板參數頁面,填寫資源棧名稱,然后按以下要求完成各配置項。
區域
參數
說明
VPC
專有網絡網段
選中192.168.0.0/16。
交換機網段
填寫192.168.0.0/24。
ECS
交換機可用區
按需選擇交換機可用區,例如可用區G。
鏡像
創建ECS使用的鏡像ID。
SharePoint鏡像下載路徑
填寫sharepoint.exe的文件URL。您可以從步驟一種獲取文件URL。
實例規格
按需選擇實例規格,例如ecs.c5.large。
實例密碼
自定義ECS實例登錄密碼。
單擊創建。
創建資源棧大約需要40分鐘。
登錄ECS實例。
單擊已創建的資源棧。
單擊資源頁簽,單擊SharePointServerALIYUN::ECS::Instance資源ID。
在ECS管理控制臺,單擊該實例右側的遠程連接,然后單擊Workbench遠程連接下的立即登錄。
體驗SharePoint。
打開SharePoint 2013管理中心,輸入默認用戶名administrator與ECS實例登錄密碼。
在SharePoint管理站點,體驗SharePoint多種功能。