VMware vSphere

 View Only
  • 1.  Cloning creates additional original reference vmdk files ... why?

    Posted Apr 26, 2017 09:02 AM

    Noob Q I am sure, but I cannot seem to find an answer to this anywhere and the noob section doesn't seem to get many (if any) answers, so I hope it is OK to post here ...

    When I do the following ...

    1 - Make a target directory (eg)

    mkdir /vmfs/volumes/datastore1/<targetVMdirectoryName>

    2 - Copy the .vmx, .nvram and .vmsd files from a master to a clone directory

    cp /vmfs/volumes/datastore1/<originalVM>/<originalVM>.vmx /vmfs/volumes/datastore1/<targetVMdirectoryName>/<CloneVMName>.vmx

    cp /vmfs/volumes/datastore1/<originalVM>/<originalVM>.nvram /vmfs/volumes/datastore1/<targetVMdirectoryName>/<CloneVMName>.nvram

    cp /vmfs/volumes/datastore1/<originalVM>/<originalVM>.vmsd /vmfs/volumes/datastore1/<targetVMdirectoryName>/<CloneVMName>.vmsd

    3 - Copy the .vmdk file

    vmkfstools -i /vmfs/volumes/datastore1/<originalVM>/<originalVM>_0.vmdk /vmfs/volumes/datastore1/<targetVMdirectoryName>/<CloneVMName>_0.vmdk -d thin

    4 - Once the copies are made, go to the new VM, rename the machine to the new required name and point the HDD to the new clone .vmdk drive

    5 - start the VM to test it works.

    When I check the directory, in addition to the .vmx, .nvram, .vmsd and .vmdk files I created/cloned, I get two more files in the datastore1 folder for the new machine which baffle me ...

    <originalVM>.nvram and <originalVM>.vmxf

    I thought that the above created an independent clone.  Why is there a reference created to the original source vmdk and why is the vmxf file the originalVM and not the CloneVMName?

    Finally, if I then create a clone from the clone, the original source reference is retained, that is the same <originalVM>.nvram and <originalVM>.vmxf named files appear as for the original clone in the Clone2 directory but no such files are created referencing the intermediate clone. 

    Why are these two files propagated through the cloning process from the original source and can I delete them/how much space do they take up?

    TIA



  • 2.  RE: Cloning creates additional original reference vmdk files ... why?

    Posted Apr 27, 2017 09:07 PM

    Hi,

    Welcome to the community. 

    I am assuming you don't have vCenter, if you do, then you should really be using vCenter to clone VM.

    Here are the files that make up a virtual machine, and they are only couple KB, the log files are couple MB

    Extension

    File Name

    Description

    .log

    <vmname>.log

    or

    vmware.log

    This is the file that keeps a log of key VMware Workstation activity. This file can be useful in troubleshooting if you encounter problems. This file is stored in the directory that holds the configuration (.vmx) file of the virtual machine.

    .nvram

    <vmname>.nvram

    or

    nvram

    This is the file that stores the state of the virtual machine's BIOS.

    .vmdk

    <vmname>.vmdk

    This is a virtual disk file, which stores the contents of the virtual machine's hard disk drive.

    A virtual disk is made up of one or more .vmdk files. If you have specified that the virtual disk should be split into 2GB chunks, the number of .vmdk files depends on the size of the virtual disk. As data is added to a virtual disk, the .vmdk files grow in size, to a maximum of 2GB each. (If you specify that all space should be allocated when you create the disk, these files start at the maximum size and do not grow.) Almost all of a .vmdk file's content is the virtual machine's data, with a small portion allotted to virtual machine overhead.

    If the virtual machine is connected directly to a physical disk, rather than to a virtual disk, the .vmdk file stores information about the partitions the virtual machine is allowed to access.

    Earlier VMware products used the extension .dsk for virtual disk files.

    <diskname>-<###>.vmdk

    This is a redo-log file, created automatically when a virtual machine has one or more snapshots. This file stores changes made to a virtual disk while the virtual machine is running. There may be more than one such file. The ### indicates a unique suffix added automatically by VMware Workstation to avoid duplicate file names.

    .vmem

    <uuid>.vmem

    The virtual machine's paging file, which backs up the guest main memory on the host file system. This file exists only when the virtual machine is running, or if the virtual machine has crashed.

    <snapshot_name_and_number>

    Each snapshot of a virtual machine that is powered on has an associated .vmem file, which contains the guest's main memory, saved as part of the snapshot.

    .vmsd

    <vmname>.vmsd

    This is a centralized file for storing information and metadata about snapshots.

    .vmsn

    <vmname>-Snapshot.vmsn

    This is the snapshot state file, which stores the running state of a virtual machine at the time you take that snapshot

    <vmname>-Snapshot<###>.vmsn

    This is the file which stores the state of a snapshot

    .vmss

    <vmname>.vmss

    This is the suspended state file, which stores the state of a suspended virtual machine

    .Some earlier VMware products used the extension .std for suspended state files

    .vmtm

    <vmname>.vmtm

    This is the configuration file containing team data.

    .vmx

    <vmname>.vmx

    This is the primary configuration file, which stores settings chosen in the New Virtual Machine Wizard or virtual machine settings editor. If you created the virtual machine under an earlier version of VMware Workstation on a Linux host, this file may have a .cfg extension

    .vmxf

    <vmname>.vmxf

    This is a supplemental configuration file for virtual machines that are in a team. Note that the .vmxf file remains if a virtual machine is removed from the team.



  • 3.  RE: Cloning creates additional original reference vmdk files ... why?

    Posted Apr 28, 2017 12:26 PM

    Thank you for taking the time to reply vfk.  I have seen and read this before on the VMware wiki (and reviewed it again following your post) but it doesn't actually answer my question - or at least I do not recognise that it answers my question (and no, I do not have vCentre).  Perhaps I can be a little more specific.

    One month ago when I decided to have a play with VMware for the first time I took an old PC and installed ESXi 6.5 on it, then created a VM I called TestInstall.

    That created the relevant files for the VM which I later cloned using the commands above to get the following files in the new directory datastore1/CloneTest/

    CloneTest.nvram

    CloneTest.vmx

    CloneTest.vmsd

    CloneTest_0.vmdk

    When I started the CloneTest VM, having previously changed the Hard disk 1 setting to point to CloneTest_0.vmdk two new files appear in the datastore1/CloneTest/ directory

    TestInstall.nvram

    TestInstall.vmxf

    Why TestInstall (ie the original VM from which the clone was taken)?  Why do I have two nvram files and why is the .vmxf file referencing the TestInstall VM and not the CloneTest VM?

    I would very much appreciate understanding this.  Also, I don't understand how a Team has been formed when a simple clone is created.  Obvioulsy I am missing more than one thing here, but I am really very green to all this (4 weeks experimenting and trying to understand it on and off is my total experience of VMware so far) so please bear that in mind when you reply.  I really do appreciate your help as I have looked and looked but cannot find anything which makes sense to me on this.



  • 4.  RE: Cloning creates additional original reference vmdk files ... why?

    Posted Apr 28, 2017 01:54 PM

    Hi,

    Those are dynmically created first VM power on. And they would be based of the VM name in vmx config file rather than display name.

    Since you cloned the VM, you will have to edit vmx file to change references to old vm name and other references to source vm.  Otherwise everythin in clone VM will still reference the source vm.



  • 5.  RE: Cloning creates additional original reference vmdk files ... why?
    Best Answer

    Posted Apr 28, 2017 03:27 PM

    You probably forgot to adjust

    nvram = "name.nvram"

    displayName = "name"

    extendedConfigFile = "name.vmxf"

    in the vmx-file.

    If those parameters do not exist they will be added automatically and new files will be created.
    By the way - if you copy a VM manually I would only copy the vmx and the vmdks.
    No need to copy the nvram and the vmsd (unless you have snapshots)



  • 6.  RE: Cloning creates additional original reference vmdk files ... why?

    Posted Apr 29, 2017 11:34 AM

    Thankyou continuum, aside from not knowing rather than 'forgot', you nailed it perfectly.  This is exactly why I like to do things the 'hard way', you learn so much:-)  Thanks to all who responded, you have all helpd a bit.