Define Users and Their Privileges
成都創(chuàng)新互聯(lián)專(zhuān)注于金灣企業(yè)網(wǎng)站建設(shè),成都響應(yīng)式網(wǎng)站建設(shè),成都做商城網(wǎng)站。金灣網(wǎng)站建設(shè)公司,為金灣等地區(qū)提供建站服務(wù)。全流程定制制作,專(zhuān)業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,成都創(chuàng)新互聯(lián)專(zhuān)業(yè)和態(tài)度為您提供的服務(wù)
Granting Privileges
查閱vCenter擁有的所有的權(quán)限
Get-VIPrivilege | Select Name, Description
查看你可以管理的管理的子對(duì)象的數(shù)目
Get-VIPrivilege | Measure-Object
你可以查看你對(duì)特定object的權(quán)限
Get-VIPrivilege -Name *Host*
Get-VIPrivilege -Name *vm*
查看權(quán)限組
Get-VIPrivilege -PrivilegeGroup | select name, description
Creating New Roles
查看vCenter已經(jīng)有的定義的角色
Get-VIRole | Select Name, Description
定義新的角色并給相應(yīng)的權(quán)限
PowerCLI C:\> New-VIRole -Name "New Custom Role" -Privilege (Get-VIPrivilege -PrivilegeGroup Datacenter)
創(chuàng)建一個(gè)新的角色:New Custom Role并具有對(duì)Datacenter操作組的所有的特權(quán):
PowerCLI C:\> New-VIRole -Name "New Custom Role1" -Privilege (Get-VIPrivilege -PrivilegeItem "create datacenter")
創(chuàng)建一個(gè)新的角色:New Custom Role1并具有 對(duì)Datacenter有新建的子權(quán)限:
Note:可以在vCenter上看到相關(guān)的結(jié)果:
可以從更小的粒度來(lái)定義角色并給角色賦予相應(yīng)的權(quán)限
$MyPriv = "Host Profile"(定義你需要的權(quán)限)
New-VIRole "New Custom Role3" -Privilege $MyPriv (定義新的角色并賦予相應(yīng)的權(quán)限)
把角色授權(quán)給用戶(hù)
語(yǔ)法
New-VIPermission [-Entity]
三個(gè)最基本的參數(shù):
Role The role which you will assign to the user
Principal The user or group to which you wish to assign permissions
Entity The object, folder, cluster, datacenter, or resource pool for which you would like to grant permissions to the user
前提:首先你要授權(quán)的用戶(hù)是已經(jīng)存在你的vCenter上的,可以是本地的,也是可以域的成員
New-VIPermission -Entity (Get-Datacenter) -Principal Virtual\test2 -Role "New Custom Role" -Propagate 1
結(jié)果:在Datacenter上Virtual\test2用戶(hù)擁有New Custom Role角色的權(quán)限,即對(duì)Datacenter有操作的權(quán)限
2. Configure Datacenters and Clusters
Creating Datacenters
http://www.vmware.com/support/developer/PowerCLI/PowerCLI51R2/html/New-Datacenter.html
必要的參數(shù):location ,name
先創(chuàng)建一個(gè)folder, 然后把新建的數(shù)據(jù)中心放進(jìn)去
$folder = Get-Folder -NoRecursion | New-Folder -Name DC_Folder
New-Datacenter -Location $folder -Name ITC_Test_DC
腳本執(zhí)行后的結(jié)果如下:
Creating Clusters
New-Cluster -Name ITC_Test -Location ITC_Test_DC
默認(rèn)情況下:HA和DRS都是沒(méi)有開(kāi)啟的,如果你沒(méi)有選擇開(kāi)啟這連個(gè)選項(xiàng)的話(huà)
腳本執(zhí)行后的結(jié)果:
Configuring High Availability
創(chuàng)建新的集群并對(duì)集群進(jìn)行開(kāi)啟HA的操作
$ProductionCluster = New-Cluster
-Location $BostonDC
-Name Production
-HAEnabled -HAAdmissionControlEnabled
-HAFailoverLevel 1
-HARestartPriority Medium
對(duì)已經(jīng)存在的集群做HA的操作
Set-Cluster
腳本實(shí)現(xiàn)后的結(jié)果:
Configuring Distributed Resource Scheduler
Configuring DRS on a new cluster(新建并開(kāi)啟DRS)
Configuring DRS on an existing cluster(對(duì)存在的進(jìn)行操作)
Set-Cluster
腳本操作的結(jié)果:
Configuring DPM on a cluster
要使用腳本來(lái)定制
Viewing License Information
Licensing a Host