1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
Set the OVF path to a variable:
$ovfpath
=
"Path_to_OVA”
Get the OVF configuration:
$ovfConfig = Get-OvfConfiguration –Ovf $ovfpath
Display the configuration properties of the OVF:
$ovfConfig.ToHashTable() | ft –autosize
You can see the list of properties that can be assigned values for deployment.
Set the appropriate configuration properties for your environment:
$ovfConfig.NetworkMapping.Network_1.Value = “Network_1″
$ovfConfig.IpAssignment.IpProtocol.Value = “IPv4″
$ovfConfig.IpAssignment.IpAllocationPolicy.Value = "
dhcpPolicy
"
Once the configuration properties are assigned, deploy the vAPP by running this command:
Import-VApp -Source "
Path_TO_OVF
" -OvfConfiguration $ovfConfig -VMHost "
IP_Address
" -Name vApp_Name -DiskStorageFormat Thin -Datastore (Get-Datastore -VMHost "
IP_Address
" -Name 'Datastore_Name')
For example:
Import-VApp -Source "
C:\NewFolder\VMware-vcops-5.8.4.0-2199700-vapp.ovf
" -OvfConfiguration $ovfConfig -VMHost "
10.1.1.1
" -Name vROpsTestvApp -DiskStorageFormat Thin -Datastore (Get-Datastore -VMHost "
10.1.1.1" -Name
'datastore1'
)
|
1
2
3
4
5
6
|
$ovfPath
=
"E:\iso\h5ngcVA-3.27.0.0-7055108_OVF10.ova"
$ovfConfig
=
Get-OvfConfiguration
-Ovf
$ovfPath
$ovfConfig
.NetworkMapping.Network_1.Value =
"Management Network"
$ovfConfig
.IpAssignment.IpProtocol.Value =
"IPv4"
$ovfConfig
.IpAssignment.IpAllocationPolicy.Value =
"dhcpPolicy"
Import-VApp
$ovfPath
-OvfConfiguration
$ovfConfig
-VMHost
"192.168.1.11"
-Name htmlclient -DiskStorageFormat Thin -Datastore vsanDatastore -force
|
本文转自bard_zhang51CTO博客,原文链接:http://blog.51cto.com/timefiles/1980299 ,如需转载请自行联系原作者