DevOps Engineer Interview Question

How would you move a hand configured legacy VM service into containers?

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

Document reality first, since nobody knows everything installed on a long lived box. Capture the running processes, packages, config files, cron jobs and outbound dependencies, then rebuild that as a Dockerfile rather than importing the disk image. Externalize local state and configuration, run the container in parallel with the VM against real traffic mirrored or shadowed, and cut over gradually with the VM kept as the rollback path.

Why interviewers ask this

Migration questions test pragmatism. The interviewer wants to know if you would attempt a big bang rewrite, or find an incremental path with a rollback. They also want to hear the unglamorous parts: discovery of undocumented dependencies, local state on disk, and cron jobs that nobody remembers, because those are what actually break these projects rather than the container build itself.

How to structure your answer

  • Start with discovery of what the box actually does.
  • Rebuild from a Dockerfile rather than snapshotting the disk.
  • Externalize state, config and scheduled jobs.
  • Run in parallel and cut over with the VM as rollback.

Example answer

Spoken example, first person

Step one is archaeology, because a box that has been up for four years is doing things nobody documented. I would capture the running processes, the listening ports, the installed packages, the cron table, the config files, and crucially the outbound connections over a week, since that reveals dependencies no diagram shows. Then I build a Dockerfile from scratch based on that, rather than importing the disk, because copying the image just carries the mess forward and I lose the whole point. The hard parts are always state and configuration. Files written to local disk have to move to object storage or a volume, config that lives in files has to come from environment or a secrets manager, and cron jobs need to become scheduled jobs rather than being baked into a long running container. Then I run the container alongside the VM, shadowing real traffic or taking a small percentage, and compare behavior. Cutover is gradual and the VM stays powered on until we have been happy for a couple of weeks, because it is the only rollback that definitely works.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • How do you find the undocumented dependencies before they bite you?
  • What would you do about a process that writes to a local file path?
  • How would you handle the cron jobs on that host?

Related devops engineer questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot