Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

How to update/extend expirationDate of an existing DevTest lab VM that already has one set?

Đang mở
#776 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
azure, powershell
Lĩnh vực
cloud

Hướng nghiên cứu

Bắt đầu với lỗi Set-AzureRmResource đã được báo cáo sau khi truy xuất VM bằng Get-AzureRmResource, và so sánh SharedImageID cùng SharedImageVersion của mẫu ARM với các thuộc tính bắt buộc customImageId và galleryImageReference. Được xem là hoàn thành khi xác định được một cách được hỗ trợ để cập nhật expirationDate mà không gây ra lỗi MissingRequiredProperties hoặc CannotSetProperty đối với các trường image.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

az.devtestlabs question

Hi,

Searching the internet we found some articles regarding how to use Azure PowerShell to extend a date on a lab VM for expiry.

Examples:

  1. https://github.com/Azure-Samples/virtual-machines-powershell-auto-expired/blob/master/README.md
  2. https://social.msdn.microsoft.com/Forums/azure/en-US/72034bf9-37c9-464e-8c2f-2ca9b9424a4c/how-to-change-or-postpone-a-vm-expiration-datetime-?forum=AzureDevTestLabs
  3. https://feedback.azure.com/forums/320373-lab-services/suggestions/34793482-postpone-expiration-date-for-individual-vms-if-nee
  4. https://azure.microsoft.com/en-gb/blog/set-expiration-date-for-vms-in-azure-devtest-labs/
    etc.

So, a lab user created a VM with 24 hr expiry and now wishes to keep it longer due to testing which has not concluded.
Whatever we try we just get the following error back on the Set-AzureRmResource command:

Set-AzureRmResource : MissingRequiredProperties : One of the following properties must be specified: customImageId, galleryImageReference.

Note our lab VM is created from an ARM template and from a lab attached shared image gallery (so a custom image in our private shared image gallery, not a public/marketplace image). As it's a private shared image gallery, it's not a true lab custom image either as such. So, in our ARM template we do not provide gallery reference or custom image ID, but more SharedImageID and SharedImageVersion.

We have tried to provide null values, or what we think may be suitable values for the "missing" properties but then we get error Set-AzureRmResource : CannotSetProperty : Cannot set or update property galleryImageReference. or Set-AzureRmResource : CannotSetProperty : Cannot set or update property customImageId.

Using AzureRm 6.13.1 but also tried Az in pwsh core and same issue.

Note that we get this error if we just get the VM object (using Get-AzureRmResource) change no properties and then set it back using Set-AzureRmResource.

Thanks!

Ngôn ngữ chính
PowerShell
Star
465
Fork
595
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Azure/azure-devtestlab

Tất cả issue của Azure/azure-devtestlab

Issue tương tự

Thêm issue về Cloud

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.