VMware Cloud Foundation(VCF)9.0 推出了统一软件仓库(Software Depot),支持连接博通在线源或企业内部离线源。但在 9.0 中,离线源默认必须使用 HTTPS + 基础认证,即使关闭 HTTPS 也依然需要认证,对纯内网环境很不友好。
在VCF 9.1中,官方带来了重要改进:VCF Installer 与全新的 Fleet Depot Service 现已支持 HTTP 无基础认证的离线软件源,纯内网环境部署更加便捷。
注意:VCF 9.1 安装器 UI 暂不支持 HTTP离线源,必须通过 API 配置。
支持协议与认证对照表
| 协议 | 基础认证 | VCF 9.0.x | VCF 9.1.0 | 说明 |
| HTTPS | ✅ | ✅ | ✅ | 默认方式 |
| HTTPS | ❌ | ❌ | ❌ | 不支持 |
| HTTP | ✅ | ✅ | ✅ | 需要旧版临时方案 |
| HTTP | ❌ | ❌ | ❌ | 仅支持 API 配置 |
一、通过 VCF Installer API 配置 HTTP 离线源
使用下面的 PowerShell 脚本配置安装器的离线源,配置会自动同步到后续部署的 Fleet Depot Service,无需重复配置。
$VCFInstallerFQDN = "sddcm01.vcf.lab" $VCFInstallerRootPassword = "VMware1!VMware1!" $VCFInstallerOfflineDepot = "http://192.168.30.29:8888" # DO NOT EDIT BEYOND HERE # $payload = @{ "username" = "admin@local" "password" = $VCFInstallerRootPassword } $body = $payload | ConvertTo-Json $params = @{ Uri = "https://${VCFInstallerFQDN}/v1/tokens" Method = 'POST' Headers = @{ 'Content-Type' = 'application/json' } SkipCertificateCheck = $true Body = $body } $requests = Invoke-WebRequest @params if($requests.StatusCode -eq 200) { $accessToken = ($requests.Content | ConvertFrom-Json).accessToken } $depotPayload = @{ "depotConfiguration" = @{ "isOfflineDepot" = $true "url" = $VCFInstallerOfflineDepot } } $depotBody = $depotPayload | ConvertTo-Json $params = @{ Uri = "https://${VCFInstallerFQDN}/v1/system/settings/depot" Method = 'PUT' Headers = @{ "Authorization" = "Bearer ${accessToken}" "Content-Type" = 'application/json' } SkipCertificateCheck = $true Body = $depotBody } Invoke-WebRequest @params二、通过 Fleet Depot Service API 重新配置 HTTP 离线源
如果你在 VCF 9.0 中用过临时方案开启 HTTP,升级 / 部署到 VCF 9.1 后,配置不会自动迁移,需要用下面的脚本重新配置 Fleet 节点的离线源。
$VCFMSFQDN = "vcf-msr01.vcf.lab" $VCFMSAdminPassword = "VMware1!VMware1!" $VCFFleetFQDN = "vcf-flt01.vcf.lab" $VCFInstallerOfflineDepot = "http://192.168.30.29:8888" # DO NOT EDIT BEYOND HERE # $params = @{ Uri = "https://${VCFMSFQDN}/api/v1/identity/token" Method = 'POST' Headers = @{ 'Content-Type' = 'application/x-www-form-urlencoded' } SkipCertificateCheck = $true Body = @{ grant_type = 'password' username = "admin@vsp.local" password = $VCFMSAdminPassword } } $requests = Invoke-WebRequest @params if($requests.StatusCode -eq 200) { $accessToken = ($requests.Content | ConvertFrom-Json).access_token } $depotPayload = @{ "depotConfiguration" = @{ "depotType" = "OFFLINE" "url" = $VCFInstallerOfflineDepot } } $depotBody = $depotPayload | ConvertTo-Json $params = @{ Uri = "https://${VCFFleetFQDN}/depot-service/api/depot/v1/connectivity" Method = 'PUT' Headers = @{ "Authorization" = "Bearer ${accessToken}" 'Content-Type' = 'application/json' } SkipCertificateCheck = $true Body = $depotBody } Invoke-WebRequest @params要点说明
VCF 9.1 支持 HTTP 无认证离线源,仅限 API 配置,UI 不支持。
通过安装器 API 配置的离线源会自动同步到 Fleet Depot。
从 9.0 升级上来的环境,必须重新用 API 配置一次 HTTP 离线源。
适用于完全隔离、无 HTTPS 证书的内网 VCF 部署场景。