我已经为我的 storageaccount 提供了一个简单的配置来启用 IIS,我已经处理了订阅,zip 存在于 blob 存储中,并且似乎设置得很好。一些输出:
VERBOSE: Performing the operation "Apply configuration 'IISInstall'" on target "VM".
[2015-05-18 21:58:13] With extensions added:
[2015-05-18 21:58:13] Microsoft.WindowsAzure.Commands.ServiceManagement.Model.PersistentVM
OperationDescription : New-AzureService
OperationId : 257df04c-cc1f-a4d5-a840-e127f9e799bd
OperationStatus : Succeeded
我创建虚拟机没有问题:
VERBOSE: 9:58:19 PM - Begin Operation: New-AzureVM - Create Deployment with VM fbconfigtest5
VERBOSE: 9:59:53 PM - Completed Operation: New-AzureVM - Create Deployment with VM fbconfigtest5
OperationDescription : New-AzureVM
OperationId : 5063c04f-8902-abb2-838a-3d7f5f685bc2
OperationStatus : Succeeded
VERBOSE: 9:59:54 PM - InstanceStatus is RoleStateUnknown
VERBOSE: 10:01:27 PM - InstanceStatus is Provisioning
VERBOSE: 10:05:36 PM - InstanceStatus is ReadyRole
[2015-05-18 22:05:36] Vm Created:
[2015-05-18 22:05:36] Succeeded
并进入轮询循环以等待 DSC 完成:
$status = Get-AzureVMDscExtensionStatus -ServiceName $ServiceName -Name $ServiceName
while($status.StatusCode -ne 1 -and $CurrTime -lt $TimeOut )
{
$CurrTime = Get-Date
$status = Get-AzureVMDscExtensionStatus -ServiceName $ServiceName -Name $ServiceName -verbose
write-log "Currents status is :"
write-log $status.Status
Write-log $status.StatusMessage
write-log $status.DscConfigurationLog
start-sleep -seconds 60
}
大约需要 5 分钟,但我报告的三种状态变化如下:
VERBOSE: 10:05:38 PM - Completed Operation: Get Deployment
WARNING: The specified resource extension reference cannot be found.
[2015-05-18 22:05:38] Currents status is :
...
VERBOSE: 10:07:43 PM - Completed Operation: Get Deployment
[2015-05-18 22:07:43] Currents status is :
[2015-05-18 22:07:43] Transitioning
[2015-05-18 22:07:44] Initializing DSC extension.
...
VERBOSE: 10:10:50 PM - Completed Operation: Get Deployment
[2015-05-18 22:10:50] Currents status is :
[2015-05-18 22:10:51] Transitioning
[2015-05-18 22:10:51] Rebooting VM to complete installation.
...
VERBOSE: 10:16:02 PM - Completed Operation: Get Deployment
[2015-05-18 22:16:02] Currents status is :
[2015-05-18 22:16:02] Error
[2015-05-18 22:16:02] An error occurred downloading the Azure Blob: Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an error: (404) Not Found."
The Set-AzureVMDscExtension cmdlet grants access to the blobs only for 1 hour; have you exceeded that interval?
这与以下博客文章中的示例代码非常相似:http: //blogs.msdn.com/b/powershell/archive/2015/02/27/introducing-get-azurevmdscextensionstatus-cmdlet-for-azure-powershell- dsc-extension.aspx
有什么问题吗,是否使用了新的命名约定?即使我再次设置配置并像这样更新虚拟机:
$aVM = Get-AzureVM -ServiceName fbconfigtest5 -Name fbconfigtest5
$aVM = Set-AzureVMDscExtension -VM $aVM -ConfigurationArchive IISInstall.ps1.zip -ConfigurationName IISInstall -ContainerName windows-powershell-dsc
$aVM | Update-AzureVM
我仍然得到同样的错误:
Get-AzureVMDscExtensionStatus -ServiceName $ServiceName -Name $ServiceName -verbose
VERBOSE: 10:51:06 PM - Completed Operation: Get Deployment
ServiceName : fbconfigtest5
Name : fbconfigtest5
Status : Error
StatusCode : -1
Timestamp : 5/18/2015 10:13:55 PM
StatusMessage : An error occurred downloading the Azure Blob: Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an
error: (404) Not Found."
The Set-AzureVMDscExtension cmdlet grants access to the blobs only for 1 hour; have you exceeded that interval?
DscConfigurationLog : {}
任何想法,想法?我将尝试更明确地说明我的上下文,但根据我的时间戳,我几乎不在这个 VM 的小时窗口内。当我回到家时,我将使用超级显式的 Config 存储、调用和上下文设置进行更新。