我已经为我的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
我创建VM没有问题:
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
有什么东西坏了,是否使用了新的命名约定?即使我再次设置Config并像这样更新vm:
$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存储,调用和上下文设置进行更新。
答案 0 :(得分:0)
请确保您使用与Publish-AzureVMDscConfiguration
中使用的相同的存储上下文,以在Set-AzureVMDscExtension
cmdlet中发布配置存档。
如果这不能指出您的问题,请添加完整的repro,包括有关如何将zip文件发布到azure的详细信息,并尝试使用新的“机器端日志中的URL”自行下载blob一小时的跑步。