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

Need better documentation on how Reimage works for VMss #6388

Closed
wamak9 opened this issue May 18, 2018 — with docs.microsoft.com · 10 comments
Closed

Need better documentation on how Reimage works for VMss #6388

wamak9 opened this issue May 18, 2018 — with docs.microsoft.com · 10 comments
Assignees
Labels
Compute az vm/vmss/image/disk/snapshot Documentation

Comments

Copy link

wamak9 commented May 18, 2018

Hi,
Need a better documentation on the reimage works.
In a VMss lets say I have 10 VMs and I want to do reimage of all the VMs. How does it work. does it do on by one with zero downtime or does it do all at once?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@yugangw-msft
Copy link
Contributor

//CC: @gatneil

@yugangw-msft yugangw-msft added the Compute az vm/vmss/image/disk/snapshot label May 18, 2018
@gatneil
Copy link

gatneil commented May 18, 2018

It does the reimage on all VMs specified in the command; if none are specified, it does all

@colemickens
Copy link
Contributor

Hi @gatneil. I am really trying understand how to build some basic scenarios around VMSS and am having a hard time coming up with some fundamentals, or Google is failing me on finding documentation.

  1. Does it reimage them all at once? Is it possible to roll it, or do I need to orchestrate that by hand by slicing instance ids and calling repeatedly?

  2. What does reimage actually mean? There seems to be an entire "Reimaging Overview" document entirely missing. Things that I need to know about:

    • pitfalls, general guidance
    • what happens to data disks
    • rate of which rollout occurs (is the reimage done on my 300 VMs all at once?)
    • what happens to the VM ID exposed to the VM
    • does 'reimage' revert just the OS disk? does it reimage to the VMSS model at the last time of upgrade, or does it "reimage" to the current VMSS model?
  3. What is the exact difference between 'upgrade', 'rolling-update' and 'reimage'? This forum post implies that "upgrade" can go one-by-one, but I thought that was exclusive to "rolling-update" and the 4 supported platform images? https://social.msdn.microsoft.com/Forums/en-US/2e9b155b-a11a-461b-ad8b-73f74814a064/vmss-upgrade-and-reimage?forum=WAVirtualMachinesforWindows (OTOH, I think the answer might have conflated Guy's tool with the API functionality inaccurately?)

A table of the three operations, along with rows like "update hw", "reset root disk", "reset disk attachments" etc, would go a long way to helping people build on top of these VMSS features.

@wamak9 wamak9 changed the title Need better documentation on the Reimage works for VMss Need better documentation on how Reimage works for VMss Jun 1, 2018
@gatneil
Copy link

gatneil commented Jun 5, 2018

Hey @colemickens! Long time no see. I actually don't work in Azure anymore, but I agree that the information should get out there. For questions 1 and 2, I threw together a couple blog posts that cover the topics:

Updating a scale set (including details around how POST APIs like reimage operate at the control plane): https://negatblog.wordpress.com/2018/06/05/updating-a-scale-set/
Reimaging VMs in a scale set (mostly focused on the data plane - what does reimage actually do?): https://negatblog.wordpress.com/2018/06/05/reimaging-vms-in-a-scale-set/

As for question 3: It depends on exact context, but I suspect "upgrade" refers to "manual upgrade" (a.k.a. "update instances"...sigh, there are too many ways to describe the same thing). When doing PUT/PATCH updates in manual upgrade mode, only the scale set model is modified; existing VMs are not. Doing a "manual upgrade" call then brings up each VM specified in the request up to date with the latest model (note: the "manual upgrade" call itself is a POST API, so it behaves as discussed in the first blog post; in particular, this means that the operation happens on all VMs specified at the same time; the upgrade policy is bypassed).

"rolling-update" likely refers to the "rolling" upgrade mode. In this mode, PUT/PATCH updates are rolled out to VMs in the scale set automatically in batches. In this mode, "manual upgrade" calls are not necessary.

Finally, "reimage" replaces the old, crusty OS disks of a specified set of VMs with new, shiny OS disks. (note: this is also a POST API, so it has the same behavior described above).

Hope this helps! Let me know if you have follow-up questions :)

@colemickens
Copy link
Contributor

@gatneil 👋 This is really great, I can't thank you enough. The PUT/PATCH/POST is a great resource too, especially including knowing how to know the request type from the docs. Thank you very much.

I think I only have one more question that you might know, and if not, I can experiment.

  1. Deploy VMSS with user image foo.vhd.
  2. Update the VMSS mode with user image bar.vhd.
  3. (Do not do any upgrade commands to bring any of the VM to the new model, or anything)
  4. Issue reimage to a VM.

Does the new OS disk come back as foo.vhd or bar.vhd?

@gatneil
Copy link

gatneil commented Jun 5, 2018

@colemickens, glad the blog posts were helpful. Let me know if you have other questions that come up. For this particular question, the new OS disk will come back as bar.vhd :)

@yugangw-msft
Copy link
Contributor

@rloutlaw, I don't think the information provided should get to the CLI's help file, rather we need a document which can bring in good information from the following sources:

https://negatblog.wordpress.com/2018/06/05/updating-a-scale-set/
https://negatblog.wordpress.com/2018/06/05/reimaging-vms-in-a-scale-set/

I am closing this, as it is not actionable for CLI team

@haroldrandom haroldrandom added Compute az vm/vmss/image/disk/snapshot Documentation labels Oct 25, 2019
@sgerace
Copy link

sgerace commented Apr 10, 2020

I'm sorry to comment on this closed ticket, however, @colemickens I happened to stumble across this issue while investigating a similar question I had, and was wondering if you were ever able to arrive at a definitive answer as to whether, in your example, you would end up with foo.vhd or bar.vhd. From my testing, it appears that I am ending up with foo.vhd — in other words, I need to explicitly run update-instances on each instance in order to have it start pulling the updated image defined in the scale set model. A simple call to reimage is not sufficient in my testing.

@gatneil, in your blog post, you mention:

Note that with both types of reimaging, the VM is reimaged to the latest model of the scale set, not the model the VM was previously running with (since, in some cases, the VM might model might have lagged behind the overall scale set model). For instance, if you were to create a scale set in manual upgrade mode with admin username “neil”, then update the scale set model to have admin username “notneil”, then reimage VM 27, when VM 27 comes back up, the admin username will be “notneil”.

This logic does not seem to apply to the referenced image itself. Is this consistent with what you would expect? Does anyone know why there might be a discrepancy?

@qJake
Copy link

qJake commented Feb 23, 2021

I also came across this thread from Google on what "Reimaging" does, and the blog article (thanks Neil!) answered my question - reimaging does re-execute the Extension scripts on the VMs.

This should be documented better on Microsoft Docs because I could not find it by searching.

@mleziva
Copy link

mleziva commented Jan 20, 2022

During my testing, if the scale set is configured to use the latest image by setting the image ID without specifying a version, using the reimage instance option from the portal will update the selected instances to the latest image.

Example image id:
/subscriptions/<subscriptionID>/resourceGroups/<resourceGroup>/providers/Microsoft.Compute/galleries/<imageGallery>/images/<imageName>"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compute az vm/vmss/image/disk/snapshot Documentation
Projects
None yet
Development

No branches or pull requests

9 participants