【问题标题】:Get-AzureVMDscExtensionStatus on Azure 9.1 is returning 404 blob errorsAzure 9.1 上的 Get-AzureVMDscExtensionStatus 返回 404 blob 错误
【发布时间】:2015-06-27 07:14:34
【问题描述】:

我为我的 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 存储、调用和上下文设置进行更新。

【问题讨论】:

  • 我能想到的只是您拥有的存储上下文不正确,因此您的代码找不到要下拉的 blob。
  • 我只是再次通过,看看发布是否创建了一个超时的租约,但是,唉...[2015-05-18 23:22:53] fbconfigtest6' VERBOSE: Configuration published to https://fbazureloggingstorage.blob.core.windows.net/windows-powershell-dsc/IIsInstall.ps1.zip [2015-05-18 23:22:55] With extensions added:
  • 20 分钟后发生同样的错误。 [2015-05-18 23:41:13] An error occurred downloading the Azure Blob: Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an erro r: (404) Not Found." 在 VM 上读取日志。
  • 所以我确实得到了该 blob URL 的 404(我假设是因为容器或 blob 的权限设置为私有......这对我来说很酷)。尝试在 blob 或容器上设置更宽松的权限(公共?)如果您确实更改了权限,您可能希望删除带有 URL 的评论。
  • 不担心打开 IIS 的配置文件。来自机器端日志的 URL 是这样的:VERBOSE: [2015-05-18T23:40:20] Downloading https://fbazureloggingstorage.blob.core.windows.net/windows-powershell-dsc/IISInstall.ps1.zip?sv=2014-02-14&sr=b&sig=zzeJbwgUtO u%2FgD1GLbHWlF17YVUYsKcDby0CFy1ZJms%3D&se=2015-05-19T00%3A22%3A55Z&sp=rd to C:\Packages\Plugins\Microsoft.Powershell.DSC\1.10.1.0\bin\..\DSCWork\IISInstall.ps1.0\IISInstall.ps1.zip VERBOSE: [2015-05-18T23:40:21] An error occurred processing the configuration package; blob 存在且已解锁。

标签: powershell azure dsc


【解决方案1】:

兰迪,

请确保您使用的存储上下文与在 Publish-AzureVMDscConfiguration 中使用的存储上下文相同,以便在 Set-AzureVMDscExtension cmdlet 中发布配置存档。

如果这没有指出问题所在,请添加完整的复制品,包括有关如何将 zip 文件发布到 azure 的详细信息,并尝试使用新的“来自机器端日志的 URL”自行下载 blob一个小时的跑步设置。

【讨论】:

    猜你喜欢
    • 2017-02-22
    • 1970-01-01
    • 2023-03-05
    • 2014-04-26
    • 2021-09-03
    • 2021-03-31
    • 1970-01-01
    • 2016-06-02
    • 2017-12-15
    相关资源
    最近更新 更多