{"id":1532,"date":"2012-09-25T20:32:26","date_gmt":"2012-09-26T00:32:26","guid":{"rendered":"http:\/\/blogs.sungeek.net\/unixwiz\/?p=1532"},"modified":"2012-09-25T20:32:26","modified_gmt":"2012-09-26T00:32:26","slug":"moving-vms-between-hosts","status":"publish","type":"post","link":"https:\/\/blogs.sungeek.net\/unixwiz\/2012\/09\/25\/moving-vms-between-hosts\/","title":{"rendered":"Moving VM&#8217;s between hosts"},"content":{"rendered":"<p>About a year ago I purchased a 1U IBM X3550 server to run VMware vSphere 5 on. While it was cool to have a server that had dual quad procs and 8 gig of ram in it, the noise it put off was too much for my family room. (Just think of half a dozen 1 inch fans running at 15,000RPM almost constantly.) Recently I have been spending more time in the family room and the noise has gotten to a level that it is almost impossible to do anything in the room with out hearing it. (Like watch tv, a movie, play a game, etc.) So I started looking at my favorite used hardware site, geeks.com, for a new &#8220;server&#8221;. Well it finally arrived today, an HP XW8600 workstation. It is another dual quad proc, however it has 16GB of ram, and 12 SATA ports and a larger case, and the best of all, almost absolutely quiet.<\/p>\n<p>So with it installed, I needed to start moving the VM&#8217;s from the IBM Server to the HP Server. In an enterprise environment, this usually isn&#8217;t a problem as you usually have a shared storage (SAN) that each of the hosts connect to. Well in my little home lab I don&#8217;t have shared storage. I did try to use COMSTAR in Solaris 10 to export a &#8220;Disk&#8221; as an iSCSI target. While this would work, it was going to take forever to transfer 1TB of VM&#8217;s from one server to a VM running on my Mac and back to the new server.<\/p>\n<p>So a googling I went, and what I found was a way easier way to copy the VM&#8217;s over. <a title=\"VMware ovftool\" href=\"http:\/\/www.vmware.com\/resources\/techresources\/1013\" target=\"_blank\">ovftool<\/a>, which runs on Windows, Linux and Mac. What it does is allow you to export and import OVF files to a VMware host. The side benefit of that is that you can export from one and import to another all on one line.<\/p>\n<p>So I downloaded the Mac version and started coping. The basic syntax is like this:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\r\n.\/ovftool -ds=TargetDataStoreName vi:\/\/root@sourcevSphereHost\/SourceVM vi:\/\/root@destvSphereHost\r\n\r\n<\/pre>\n<p>So if one of my VM&#8217;s is called mtdew, and I had it thin provisioned on the source host and wanted it the same on the destination host, and my datastore is called &#8220;vmwareraid&#8221; I would run this:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n.\/ovftool -ds=vmwareraid -dm=thin vi:\/\/root@ibmx3550\/mtdew vi:\/\/root@hpxw8600\r\n<\/pre>\n<p>where ibmx3550 is the source server and hpxw8600 is the destination server. If you don&#8217;t specify the &#8220;-dm=thin&#8221; then when it is copied over, it will become a &#8220;thick&#8221; disk, aka us the entire space allocated when created. (I.E. a 50GB disk that only has 10GB in use would still use 50GB if the -dm=thin is not used.)<\/p>\n<p>There are some gotchas that you will have to look out for:<\/p>\n<ol>\n<li>Network configs, I had one VM that had multiple internal network&#8217;s defined. Those were not defined on the new server, so there is a &#8220;mapping&#8221; that you have to do. I decided I didn&#8217;t need them on the new server so I just deleted them before I copied it over.<\/li>\n<li>VM&#8217;s must be in a powered off state. I tried them in a &#8220;paused&#8221; state and it did not want to run right.<\/li>\n<li>It takes time, depending on the speed of the network, disk, etc, it will take a lot of time to do this, and the VM&#8217;s have to be down while it happens. So definitely not a way to move &#8220;production&#8221; vm&#8217;s unless you have a maintenance window.<\/li>\n<li>It will show % complete as it goes, which is cool, but the way it does it is weird. It will show the % at like 11 or 12 and then I turn my head and all of the sudden it says it is completed.<\/li>\n<li>I did have some issues with a vm that I am not sure what happened to it, but when I try to copy it, I get an error: &#8220;Error: vim.fault.FileNotFound&#8221;&#8230; It may be due to me renaming something on the vm at some point in the past.<\/li>\n<\/ol>\n<p>Hope this helps some other &#8220;home lab user&#8221;&#8230;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>About a year ago I purchased a 1U IBM X3550 server to run VMware vSphere 5 on. While it was cool to have a server that had dual quad procs and 8 gig of ram in it, the noise it put off was too much for my family room. (Just think of half a dozen &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blogs.sungeek.net\/unixwiz\/2012\/09\/25\/moving-vms-between-hosts\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Moving VM&#8217;s between hosts&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[109,41,152],"tags":[362,155,520,361,483,521,153],"class_list":["post-1532","post","type-post","status-publish","format-standard","hentry","category-howto","category-tips","category-vmware","tag-moving-vms","tag-esxi","tag-howto","tag-ovftool","tag-tips","tag-vmware","tag-vsphere"],"_links":{"self":[{"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/posts\/1532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/comments?post=1532"}],"version-history":[{"count":5,"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/posts\/1532\/revisions"}],"predecessor-version":[{"id":1537,"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/posts\/1532\/revisions\/1537"}],"wp:attachment":[{"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/media?parent=1532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/categories?post=1532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.sungeek.net\/unixwiz\/wp-json\/wp\/v2\/tags?post=1532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}