Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-AzVMOperatingSystem won't work for existing VMs #16711

Closed
KMoraz opened this issue Dec 27, 2021 · 5 comments
Closed

Set-AzVMOperatingSystem won't work for existing VMs #16711

KMoraz opened this issue Dec 27, 2021 · 5 comments
Assignees
Labels
Compute - VM customer-reported CXP Attention [Deprecated] The Azure CXP Support Team is responsible for this issue. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@KMoraz
Copy link

KMoraz commented Dec 27, 2021

Description

This might be a documentation error, as official docs doesn't explicitly specify that Set-AzVMOperatingSystem cmdlet intended for new VMs and won't work for existing ones. The examples also target new VMs.

Issue script & Debug output

$vm = Get-AzVM -ResourceGroupName "someRG" -VMName "someVM"

# Running VM has DisablePasswordAuthentication=false, try to revert that:
Set-AzVMOperatingSystem -VM $vm -Linux -ComputerName $vm.OSProfile.ComputerName -Credential $cred -DisablePasswordAuthentication

# Refresh current configuration
(Get-AzVM -ResourceGroupName $vm.ResourceGroupName -VMName $vm.Name).OSProfile.LinuxConfiguration.DisablePasswordAuthentication

# output: False

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.1
PSEdition                      Core
GitCommitId                    7.2.1
OS                             Microsoft Windows 10.0.22523
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

Name         Version
----         -------
Az.Accounts  2.2.3
Az.Compute   4.8.0
Az.Resources 3.1.1

Error output

No response

@KMoraz KMoraz added bug This issue requires a change to an existing behavior in the product in order to be resolved. needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Dec 27, 2021
@ghost ghost added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Dec 27, 2021
@dingmeng-xue dingmeng-xue added Compute - VM CXP Attention [Deprecated] The Azure CXP Support Team is responsible for this issue. labels Dec 28, 2021
@dingmeng-xue
Copy link
Member

Thanks for reporting. We believe this inconsistency should be resolve by service side. I reply team member to look into it further.

@SaurabhSharma-MSFT SaurabhSharma-MSFT self-assigned this Dec 28, 2021
@SaurabhSharma-MSFT
Copy link
Member

SaurabhSharma-MSFT commented Dec 29, 2021

@KMoraz Thanks for your feedback. You are correct, and the cmdlet Set-AzVMOperatingSystem is not working to update linux properties. I am working internally on the same and update the documentation as required.

@SaurabhSharma-MSFT
Copy link
Member

@KMoraz I have got the confirmation and this command is intended to be used on local VM objects to update OS properties before VM creation. This is by design and we cannot modify OS properties after the creation of the VM using this command.

@SaurabhSharma-MSFT SaurabhSharma-MSFT added the needs-author-feedback More information is needed from author to address the issue. label Mar 18, 2022
@KMoraz
Copy link
Author

KMoraz commented Mar 20, 2022

@SaurabhSharma-MSFT I assumed that was the case, which is why I indicated that it was probably a documentation error.

Subtitle should be: Sets operating system properties during creation of a new virtual machine.

@ghost ghost added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Mar 20, 2022
@SaurabhSharma-MSFT
Copy link
Member

SaurabhSharma-MSFT commented Mar 29, 2022

@KMoraz Thanks for your suggestions. I have submitted PR to update the documentation and it will be merged once approved by the reviewers.
We will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.

@SaurabhSharma-MSFT SaurabhSharma-MSFT removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Mar 29, 2022
BethanyZhou pushed a commit that referenced this issue Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compute - VM customer-reported CXP Attention [Deprecated] The Azure CXP Support Team is responsible for this issue. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

3 participants