Jan 222013
 

A step by step guide to moving a virtual machine from one datastore to another in VMware ESXi 5.1 (probably applies to earlier versions too)

I had been running my VMware host with two small physical hard drives, but added a new SATA III 2TB drive which should be a bit faster and give me space for more images. I needed to migrate my existing guests to the new datastore.

In the vSphere Client, expand the host in the left window of the inventory screen and highlight the guest you want to migrate. Click the ‘Summary’ tab in the right pane.

Under ‘Resources’, right-click on the datastore and choose ‘Browse Datastore…’

Browse Datastore...

Browse Datastore…

In the Datastore Browser, click the folder in the left window which contains your guest OS files. Click the ‘Move a file…’ button on the menu bar.

Move a file

Move a file…

Click ‘Yes’ on the Confirm Move pop-up window.

Confirm move

Confirm move

In the ‘Move Items To…’ dialog, choose the new Datastore (and a directory if you like) and click the ‘Move’ button.

Move To...

Move To…

The directory will be moved – the progress bar shows how long remains.

Moving progress bar

Moving progress bar

Once the move is complete, the virtual machine will still be listed in the inventory, but it still links to the old location, so if you try to power it on you will get an error message.

Error message

Error message

To resolve this, right-click the guest in the inventory and choose ‘Remove from Inventory’

Remove from Inventory

Remove from Inventory

Highlight the host at the top of the inventory list, then click the ‘Configuration’ tab. You should see all your datastores listed. Right-click the datastore you moved the guest to and choose ‘Browse Datastore…’, open the directory which you moved in the earlier step and locate the .vmx file. Right click it and choose ‘Add to Inventory…’

Add to inventory

Add to inventory

Choose a new name for the image if appropriate.

Choose a name

Choose a name

Click ‘Next’ on the Resource Pool Screen.

Resource pool

Resource pool

Click ‘Finish’ on the Ready to Complete screen.

Ready to complete

Ready to complete

Your guest will now appear in the inventory list again. When you power the guest on, you will be asked whether you moved or copied the machine. Choose ‘I moved it’ .

Virtual Machine Question

Virtual Machine Question

Your guest OS should now boot from the new datastore.

Guest Booting

Guest Booting

Let me know in the comments how you get on, or if any of the instructions above are unclear.

 

 

 

  2 Responses to “Migrate a guest OS to a new datastore in ESXi 5.1”

Comments (2)
  1. Updates file paths to virtual machine files on a datastore after the datastore has been resignatured.
    Bill B. Ross´s last blog post ..No last blog posts to return.

  2. Why do I continue to see the original datastore in the summary (as well as the new one)? Is there any potential issues that the old datastore is still linked to this vm?

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

CommentLuv badge

%d bloggers like this: