{"id":202,"date":"2011-06-12T12:07:00","date_gmt":"2011-06-12T12:07:00","guid":{"rendered":"https:\/\/www.geekmungus.co.uk\/?p=202"},"modified":"2022-11-05T10:53:43","modified_gmt":"2022-11-05T10:53:43","slug":"moving-a-vm-from-local-storage-to-the-san","status":"publish","type":"post","link":"https:\/\/geekmungus.co.uk\/?p=202","title":{"rendered":"Moving a VM from local storage to the SAN"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This is a way to move the VMDKs for a VM from local storage to the SAN.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First you need to get your SAN hooked in, once you do this, SSH onto the box, under your vmfs directory you&#8217;ll find the directories (links) to the LUNs presented from your SAN.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To move from \/vmfs\/volumes\/storage1 to \/vmfs\/volumes\/storage2<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1) Create a folder in the new datastore eg:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>mkdir \/vmfs\/volumes\/storage2\/vm_name<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2) Copy across the hard drives, repeat for each vmdk (Not the -flat files)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>vmkfstools -i \/vmfs\/volumes\/storage1\/vm_name\/diskname.vmdk \/vmfs\/volumes\/storage2\/vm_name\/diskname.vmdk<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(It\u2019s important to use vmkfstools here and not cp in order to avoid fragmentation, also its a lot quicker)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3) Copy across the .vmx file<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>cp \/vmfs\/volumes\/storage1\/vm_name\/vmname.vmx \/vmfs\/volumes\/storage2\/vm_name\/vmname.vmx<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4) In the VI Client browse the new datastore, right click on the transferred .vmx file and select \u201cAdd to Inventory\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">5) Start up new VM and once happy with it, delete the old copy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Best seen with an example:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>vmkfstools -i \/vmfs\/volumes\/datastore1\/SERVER01\/SERVER01.vmdk \/vmfs\/volumes\/datastore2\/SERVER01\/SERVER01.vmdk<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>cp \/vmfs\/volumes\/datastore1\/SERVER01\/SERVER01.vmx \/vmfs\/volumes\/datastore2\/SERVER01\/SERVER01.vmx<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a way to move the VMDKs for a VM from local storage to the SAN. First you need to get your SAN hooked in, once you do this, SSH onto the box, under your vmfs directory you&#8217;ll find the directories (links) to the LUNs presented from your SAN. To move from \/vmfs\/volumes\/storage1 to &#8230; <a title=\"Moving a VM from local storage to the SAN\" class=\"read-more\" href=\"https:\/\/geekmungus.co.uk\/?p=202\" aria-label=\"Read more about Moving a VM from local storage to the SAN\">Read more<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-202","post","type-post","status-publish","format-standard","hentry","category-vmware"],"_links":{"self":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=202"}],"version-history":[{"count":1,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/202\/revisions"}],"predecessor-version":[{"id":1597,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/202\/revisions\/1597"}],"wp:attachment":[{"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geekmungus.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}