博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Creating Hyperv Agent Installer
阅读量:4986 次
发布时间:2019-06-12

本文共 4892 字,大约阅读时间需要 16 分钟。

 
 
 

Pre-built Hyper-V Agent Installer

If you want to use pre-built Hyper-V Agent Installer then you can download from jenkins.

For master you can download from  and for other releases search for appropriate job at  . 

Creating Hyper-V Agent Installer

To build on windows you have to follow instructions of step 1 at.

In addition to packages mentioned there you have to select wget package also.

Install mono on windows. You can download mono from .

Before building  import all certificates using below command in Cygwin

mozroots --import --ask-remove

After setting up the environment you can build the agent using Cygwin. In Cygwin you have to execute  buildagent.sh script. This script is present in (cloudstack src folder)/plugins/hypervisors/hyperv

To build on Linux you can refer to Donal's blog .

Installing and uninstalling Service from Command line

After building you will get the output/executable in (cloudstack src folder)//plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/bin/Debug

That output folder can be zipped and can be distributed.

In that output folder there is one executable generated AgentShell.exe.

From command line that can be used to install and uninstall service as follows

To install service

  • AgentShell.exe --install -u <username> -p <password>

              where username is of form domain\username or username for example Administrator or blr\Administrator

              This user should be part of local Administrators and Hyper-V Administrators group on the host

To uninstall service

  • AgentShell.exe --uninstall

 

Note: Apart from installing service you have to manually create and add ssl certificate. For that you can follow the steps here 

 

To build clickable installer

First you have to download the source code from github .

Copy the InstallerSetup folder in (cloudstack src folder)//plugins/hypervisors/hyperv/DotNet/

After building the agent run one of the following command in (cloudstack src folder)//plugins/hypervisors/hyperv/DotNet/InstallerSetup/CloudStackAgentSetup

  • msbuild CloudStackAgentSetup.wixproj

                   or

  • MSBuild.exe CloudStackAgentSetup.wixproj

Installer will be generated in bin/debug folder of CloudAgentSetup proj (cloudstack src folder)//plugins/hypervisors/hyperv/DotNet/InstallerSetup/CloudStackAgentSetup/bin/Debug

 

CloudStackAgentSetup code uses the WixCommonUiExtension.dll with Eclipse Public License

Installing msi through command line

To install msi through command line quietly one can use the following command

msiexec /i CloudStackAgentSetup.msi /quiet /qn /norestart /log install.log SERVICE_USERNAME=<username> SERVICE_PASSWORD=<password>

If you don't want to install certificate with installer then execute as follows

msiexec /i CloudStackAgentSetup.msi /quiet /qn /norestart /log install.log SERVICE_USERNAME=<username> SERVICE_PASSWORD=<password> INSTALL_CERTIFICATE="False"

Deploy software via Group Policy’s Scheduled Tasks

Create .bat script which does the following

  • copies CloudStackAgentSetup.msi from a networked resource (shared folder) to Hyper-V host
  • installs the CloudStackAgentSetup.msi(use one of the method mentioned in above section, Installing msi through command line)
  • set the appropriate location for logs (replace install.log with your file)
  • deletes the CloudStackAgentSetup.msi from Hyper-V host after installation
  • save the .bat file as install-cloudstack-hyperv-agent.bat .

 

Create and deploy a scheduled task via group policy

  • Open Group Policy Management
  • Navigate to the Organization Unit you wish to receive CloudStack Hyper-V Agent deployment via a schedule task
  • Right-click on your target OU and select “Create a GPO in this domain, and Link it here”
  • Name: Deploy Application via Scheduled Tasks
  • Group Policy Management Editor > Computer Configuration > Preferences > Control Panel Settings > Scheduled Tasks
  • Right-click on Scheduled Tasks > New > Scheduled Tasks
  • Tab Tasks > Action > Create
  • Tab Task > Name > Install CloudStack Hyper-V Agent
  • Tab Task > Run > \\path to bat script\install-cloudstack-hyperv-agent.bat
  • Tab Task > Enabled > checked
  • Tab Schedule > Scheduled Task > Once, 2:00:00 AM
  • Tab Schedule > Scheduled Task Once > Run On > Pick a day that is best for you
  • (optional) Tab Settings > Power Management > Wake the computer to run this task > checked

Link this Group Policy to one or more OUs and under Security Filtering, add Authenticated Users and Domain Computers.

 

For more details refer to 

To build clickable installer using Visual studio

Add the project to visual Studio and build it Visual Studio as normal build

(cloudstack src folder)//plugins/hypervisors/hyperv/DotNet/InstallerSetup/CloudStackAgentSetup

Troubleshooting

If any command is not working make sure that it is environment path

To get msbuild on path add the following path to Path environment variable

C:\Windows\Microsoft.NET\Framework\v4.0.30319

.

  • No labels

Page: 

转载于:https://www.cnblogs.com/liangwang/p/5291044.html

你可能感兴趣的文章
python列表操作
查看>>
leetcode 53 最大子序和 (Maximum Subarray)
查看>>
FZU 1919 -- K-way Merging sort(记忆化搜索)
查看>>
Ubuntu 下常用快捷键
查看>>
Node.js安装及环境配置之Windows篇
查看>>
Git分支管理
查看>>
位运算
查看>>
SQL Server-删除表中重复的记录!
查看>>
Ubuntu Code::Blocks IDE 13.12 汉化
查看>>
Linux vim 常用命令
查看>>
document.write与document.getelementById(),output的作用对象区别
查看>>
大学生程序设计邀请赛(华东师范大学)B. 分词 DP
查看>>
IBM MQ常用命令
查看>>
RedHat 无法使用YUM源问题
查看>>
实战重构工厂模式
查看>>
Flask的上下文管理:Werkzeug库的local模块
查看>>
Python学习之路-5 (元祖数据类型)
查看>>
转:ASP.NET MVC HtmlHelper用法大全
查看>>
课后作业-阅读任务-阅读提问-4
查看>>
基于meanshift的手势跟踪与电脑鼠标控制(手势交互系统)
查看>>