Anda di halaman 1dari 7

11/15/2016

MovingorcopyingavirtualmachinewithinaVMwareenvironment(1000936)|VMwareKB

MovingorcopyingavirtualmachinewithinaVMware
environment(1000936)
1
2
3
4
5
165Ratings

Details
Incertaincircumstancesyoumaywanttorelocateavirtualmachinefromonelocationtoanotherlocation.These
circumstancesmayinclude,butarenotlimitedto,thefollowing:
MovingavirtualmachinefromaplatformusingoneVMwareproducttoadifferentplatformusinganotherVMware
product.
Troubleshootingissuesinvolvinghighdiskspaceusage.
Balancingdiskspaceusage.
Cloningavirtualmachine.
Backingupavirtualmachine.
ThisarticleexploresanddescribesdifferentmethodsofrelocatingvirtualmachinefileswithinyourVMwareenvironment.

Solution

ExistingVMwareProductsandFeatures
Priortomanuallymovingorcopyingvirtualmachinediskfiles,considerusingexistingVMwarefeatureswhichcanaccomplish
similardesiredresults.TheseVMwarefeaturesinclude:
ConvertingvirtualmachineswithVMwareConverter.Formoreinformation,seetheVMwareConverterStandalone
Documentation(http://www.vmware.com/support/pubs/converter_pubs.html).
ConvertingvirtualmachineswithVMwarevCenterConverter.Formoreinformation,seetheVMwarevCenterConverter
AdministrationGuide(http://www.vmware.com/support/pubs/)foryourVMwareproductversion.
LiveMigrate,ColdMigrate,Clone,orStoragevMotionwithVMwarevCenterorVMwareVirtualCenter.Formore
information,seetheMigratingVirtualMachinesintheBasicSystemAdministrationGuide(http://www.vmware.com/support/pubs/)
foryourVMwareproductversion.
https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1000936

1/7

11/15/2016

MovingorcopyingavirtualmachinewithinaVMwareenvironment(1000936)|VMwareKB

BackingupvirtualmachineswithVMwareConsolidatedBackup.Formoreinformation,seetheVirtualMachineBackup
Guide(http://www.vmware.com/support/pubs/)foryourVMwareproductversion.

ConsiderationsandCaveats
Thefollowingareseveralcaveatsspecifictomovingorrelocatingvirtualmachinediskfiles:
DifferentversionsofVMwareproductsmayhavedifferentimplementationsofavirtualdiskfile.Formoreinformation,
pleaseseeVirtualMachineDiskFormat(VMDK)(http://www.vmware.com/interfaces/vmdk.html).
Whenusingsnapshots,avirtualmachine'svirtualdiskscanbecomprisedofmultipleVMDKfileswhicharepartofan
interdependentchain.Formoreinformation,seeDiskChainingandRedoLogsintheVirtualDiskAPIProgramming
Guide(http://www.vmware.com/support/developer/vddk/).
TopreventperformanceanddatamanagementrelatedissuesonESX,avoidtheuseofusingscp,cp,ormvforstorage
operationsinsteadusevmkfstools,VMware'svirtualmachineImportertool.Formoreinformationregardingtheusageof
toolswithintheserviceconsole,seeThirdPartySoftwareintheServiceConsole(http://www.vmware.com/pdf/esx_3p_scvcons.pdf).
Toavoidanypotentialissuesinvolvingsnapshotsandinconsistentdiskchains,ensurethatthevirtualmachinedoesnot
haveanysnapshots.Movingvirtualmachineswithsnapshotsisoutsideofthescopeofthisarticle,andVMware
stronglyrecommendsusingoneofthealternatemethodsdescribedabove.
Youmustknowexactlywherethevirtualdiskfileyouwanttomoveislocated,andyoumustensurethatthevirtual
machineispoweredoff.

Copyingormovingthevirtualmachineandvirtualdisks
Followthesehighlevelstepstomoveavirtualmachinetoanalternatelocation:

1.Selectthevirtualmachine.
2.Commitallsnapshotsonthevirtualmachine.Formoreinformation,seeCommittingsnapshotsfromwithintheService
Console(1006847)(http://kb.vmware.com/kb/1006847).
3.Identifytheworkingdirectoryofthevirtualmachine.
4.Identifythelocationofallvirtualdisks.
5.Poweroffthevirtualmachine.
6.Createafolderforthecopyofthevirtualmachine.
7.Copythevirtualmachineconfigurationfile(.vmx)tothenewfolder.
8.Copythevirtualdiskstothenewfolder.Formoreinformation,seeMovingorCopyingVirtualDisksinaVMware
Environment(900)(http://kb.vmware.com/kb/900).
9.Registerthenewvirtualmachine.
10.Addthevirtualdiskcopiestothevirtualmachinecopy.
11. Upgradethevirtualhardwareifnecessary.
12.Poweronthevirtualmachine.
13.Testthenewvirtualmachine.
14.Optionally,deletetheoriginalvirtualmachinefiles.

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1000936

2/7

11/15/2016

MovingorcopyingavirtualmachinewithinaVMwareenvironment(1000936)|VMwareKB

Note:Formoreinformationaboutperformingthesegeneralsteps,seeCommandsforESXandESXiandCommandsfor
VMwareServerandVMwaredesktopproductsinthisarticle.

Creatinganewvirtualmachineandcopyingormovingthevirtualdisks
Creatinganewvirtualmachineinsteadofcopyingtheoriginalvirtualmachineconfigurationfilehasadvantages.Bycreatinga
newvirtualmachine,youdonothavetocreatefolders,upgradethevirtualmachinehardware,orregisteravirtualmachine.

Followthesehighlevelstepstorecreateavirtualmachineinanalternatelocation:
1.Selectthevirtualmachine.
2.Makenoteofthenetworking,memory,andCPUconfigurationofthevirtualmachine.
3.Commitallsnapshotsonthevirtualmachine.Formoreinformation,seeCommittingsnapshotsfromwithintheService
Console(1006847)(http://kb.vmware.com/kb/1006847).
4.Identifythelocationofallvirtualdisks.
5.Poweroffthevirtualmachine.
6.Removevirtualdisks.
Warning:Donotdeletethevirtualdisk.

7.Createanewvirtualmachineandrecreatetheconfigurationidentifiedinstep2.
8.Copythevirtualdiskstothefolderofthenewvirtualmachine.Formoreinformation,seeMovingorCopyingVirtual
DisksinaVMwareEnvironment(900)(http://kb.vmware.com/kb/900).
9.Addthevirtualdiskcopiestothenewvirtualmachine.
10.Poweronthenewvirtualmachine.
11. Testthenewvirtualmachine.
12.Optionally,deletetheoriginalvirtualmachinefiles.
Note:Formoreinformationaboutperformingthesegeneralsteps,seeCommandsforESXandESXiandCommandsfor
VMwareServerandVMwaredesktopproductsinthisarticle.

CommandsforESXandESXi
Thestepstocreateacopyavirtualmachinetoanewlocationorrecreateavirtualmachineinanalternatelocationaredifferent
forESXandESXi.

Forspecificinstructionstoperformthefollowingtasks,seetheappropriateproductdocumentation
(http://www.vmware.com/support/pubs/):
Poweronthevirtualmachine
Poweroffthevirtualmachine
Removevirtualdisks
Upgradethevirtualhardware
Addingvirtualdisks
https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1000936

3/7

11/15/2016

MovingorcopyingavirtualmachinewithinaVMwareenvironment(1000936)|VMwareKB

Warning:Incertainsituations,youmaywanttorunsomeoftheabovestepsviathecommandlineorserviceconsole.To
supportcertaininternaloperations,ESXinstallationsincludeasubsetofstandardLinuxconfigurationcommands(forexample,
networkandstorageconfigurationcommands).Usingthesecommandstoperformconfigurationtaskscanresultinserious
configurationconflictsandrendersomeESXfunctionsunusable.AlwaysworkthroughthevSphereClientwhenconfiguring
ESX,unlessotherwiseinstructedinvSpheredocumentationorbyVMwareTechnicalSupport.

Registeringavirtualmachine

ToregisteravirtualmachinefromtheESXServiceConsole,runthecommand:
vmwarecmd<cfg>register,where<cfg>isthefullpathtothevmxfile

where<cfg>isthefullpathtothe.vmxfile

InVersionsESXi4.1,5.0,5.1and5.5vmwarecmdisnolongeravalidcommand.vCLI(vSphereCLI)willhavetobe
installed.Pleaseseethefollowinglinkformoreinformation:
OverviewofvSphereCommandLineInterfaces (http://pubs.vmware.com/vsphere55/topic/com.vmware.vcli.getstart.doc/cli_jumpstart.3.2.html)

ToregisteravirtualmachinefromESXiandthevSphereCLI,runthecommand:
vmwarecmd.plH<host>U<username>P<password><cfg>register

where<cfg>isthefullpathtothe.vmxfile

InESXi5.x,usethiscommandtoregisterthevirtualmachine:
vmwarecmd.plH<vc_server>U<login_userP<login_passwordvihost<esx_host>s
register/vmfs/volumes/Storage2/testvm/testvm.vmx

Note:Thesystemreturns0toindicatesuccess,1toindicatefailure.

Identifyingtheworkingdirectory

ToidentifytheworkingdirectoryofthevirtualmachinefromtheESXServiceConsole,runthecommand:
vmwarecmdl

ToidentifytheworkingdirectoryofthevirtualmachinefromESXiandthevSphereCLI,runthecommand:
vmwarecmd.plH<host>U<username>P<password>l

Identifyingthelocationofallvirtualdisks

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1000936

4/7

11/15/2016

MovingorcopyingavirtualmachinewithinaVMwareenvironment(1000936)|VMwareKB

ToidentifythelocationofallvirtualdisksfromtheESXServiceConsole,runthecommand:
grepivmdk<cfg>

where<cfg>isthefullpathtothevmxfile

Creatingafolderforthecopyofthevirtualmachine

TocreateafolderforthecopyofthevirtualmachinefromtheESXServiceConsole,runthecommand:
mkdir/vmfs/volumes/<datastore>/<dir>

where<datastore>isthedesireddatastore,and<dir>isthedesireddirectoryname

TocreateafolderforthecopyofthevirtualmachinefromESXiandthevSphereCLI,runthecommand:
vifs.plH<host>U<username>P<password>mkdir'[datastore]dir'

wheredatastoreisthenameofthedatastore,anddiristhenameofthenewdirectory

Copyingthevirtualmachineconfigurationfiletothenewfolder
Tocopythevirtualmachineconfiguration(.vmx)filetothenewfolderfromtheESXServiceConsole,runthecommand:
cp<source><destination>

where<source>isthefullpathofthevirtualmachineconfigurationfile,and<destination>isthedesiredlocation
forthe.vmxfile.

TocopythevirtualmachineconfigurationfiletothenewfolderfromESXiandthevSphereCLI,runthecommand:
vifs.plH<host>U<username>P<password>copy'[srcdatastore]<srcdir>/<vmx>'
'[dstdatastore]<dstdir>/<vmx>'

where:

srcdatastoreanddstdatastorearethesourceanddestinationdatastores
<srcdir>and<dstdir>arethesourceanddestinationdirectories
<vmx>isthenameofthe.vmxfile
Notes:
FormoreinformationaboutusingthevSphereCommandLineInterface,seevSphereCommandLineInterface
Documentation(http://www.vmware.com/support/developer/vcli/).

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1000936

5/7

11/15/2016

MovingorcopyingavirtualmachinewithinaVMwareenvironment(1000936)|VMwareKB

FormoreinformationaboutESXspecificcommands,seetheAppendicesoftheESXServerConfigurationGuide
(http://www.vmware.com/support/pubs/)foryourVMwareproductversion.

Copyingvirtualdiskfilesacrossthenetworktoandfromdifferentplatforms
Movingvirtualdiskfilesacrossanetworkcanbeaccomplishedinmanywaysandonmanyplatforms.Hereareseveral
optionstotransportfilesacrosstodifferentplatforms:
FTPfiletransfer
SCPfiletransfer
NFSshares
WindowsFileSharing(CIFSshares)
Stepsonhowtoenable,configure,andtransferfilesusingthesespecificmethodsareoutsideofthescopeofthisarticle.
Whentransferringvirtualdiskfilesacrossthenetwork,VMwarerecommendsvalidatingtheinformationbeforeandafterthefile
transfer.ThiscanbedonebyusingMD5checksums.FormoreinformationaboutMD5checksums,pleaseseeUsingMD5
Checksums(http://www.vmware.com/download/md5.html).

AdditionalInformation:
Fortranslatedversionsofthisarticle,see:
SpanishMoverocopiarunamquinavirtualdentrodeunentornodeVMware(2016356)(/selfservice/search.do?
cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=2016356)

PortugueseMovendooucopiandoumamquinavirtualemambienteVMware(2014495)(/selfservice/search.do?
cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=2014495)

JapaneseVMware(2052811)(/selfservice/search.do?
cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=2052811)

:VMware(2086069)(/selfservice/search.do?
cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=2086069)

Tags
movingcopyingvmvirtualmachine
This Article Replaces
935,10102,1001852,1002313,1002563,1006457,1008604,1010167,10144497267036,9079274
Request a Product Feature
TorequestanewproductfeatureortoprovidefeedbackonaVMwareproduct,pleasevisittheRequestaProduct
Feature(http://www.vmware.com/contact/contactus.html?department=prod_request)page.
Permalinkto:MovingorcopyingavirtualmachinewithinaVMwareenvironment(https://kb.vmware.com/kb/1000936)
Readourblog(http://blogs.vmware.com/kb/)
WatchKBTV(http://blogs.vmware.com/kbtv/)
Followus(https://twitter.com/vmwarecares)
RequestNewContent(http://www.vmware.com/landing_pages/knowledgebasecontentrequest.html)
https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1000936

6/7

11/15/2016

MovingorcopyingavirtualmachinewithinaVMwareenvironment(1000936)|VMwareKB

1
2
3
4
5
165Ratings

Actions
BookmarkDocument

PrintDocument

SubscribetoDocument(/selfservice/microsites/microsite.do?

cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=1000936&format=rss)

(//www.addthis.com/bookmark.php?

v=250&username=xa4b5f42f36e60a29e)

KB:1000936
Updated:Sep1,2014
Categories:
Howto
Languages:
English
Product(s):
VMwareESX
VMwareESXi

https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1000936

7/7

Anda mungkin juga menyukai