VMware Fusion Operations: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
(28 intermediate revisions by the same user not shown)
Line 3: Line 3:
* [[VMware Fusion#Subjects|VMware Fusion]]
* [[VMware Fusion#Subjects|VMware Fusion]]


=Procedures=
=New VMware Virtual Machine Provisioning=


=Changing the Number of CPUs Allocated to a VM=
{{Internal|VMware Fusion Virtual Machine Provisioning#Procedure|VMware Fusion Virtual Machine Provisioning}}


Virtual Machine -> Settings -> System Settings row -> Processors & Memory -> Processors.
=VMware Virtual Machine Cloning=


=Clone a VM=
{{Internal|Clone a VMware Fusion Virtual Machine#Procedure|Clone a VMware Fusion Virtual Machine}}


==External==
=Rename VM Bundle Files=


* https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1001524
{{Internal|Rename VMware VM Bundle Files|Rename VM Bundle Files}}


==Procedure==
=Changing the Number of CPUs Allocated to a VM=


Power off the VM.
Virtual Machine -> Settings -> System Settings row -> Processors & Memory -> Processors.
 
Find the [[VMware_Fusion_Concepts#VM_Bundle|VM bundle]].
 
Copy the VM bundle in a different location.
 
If you want to change the bundle file names, follow this procedure "[[#Rename_VM_Bundle_Files|Rename VM Bundle Files]]", '''at this time, and not later'''.
 
Power on the copy.
 
Fusion will ask if the VM was moved or copied:
 
:[[Image:VMware_Fusion_Operations_Moved_or_Copied.png]]
 
Select "Copied" - a new UUID and MAC address will be generated.
 
Go to [[#Rename_a_VM|Rename a VM]]. Renaming is unnecessary if "[[#Rename_VM_Bundle_Files|Rename VM Bundle Files]]" was performed, the machine is already removed.
 
If the copied VM relies on getting of an IP from the built-in DHCP server and we want a static address, follow this procedure "[[VMware_Fusion_Configuration#Configure_DHCP_to_Serve_a_Static_Address|Configure DHCP to Serve a Static Address]]"
 
Then reconfigure the quest OS, as described here:
 
<span id="Reconfigure_Linux_VM_Guest_Image"></span>{{Internal|Reconfigure Linux VM Guest Image|Reconfigure Linux VM Guest Image}}


=Rename a VM=
=Rename a VM=
Line 55: Line 33:
Note that renaming the VM does not change the name of any bundle file on disk.
Note that renaming the VM does not change the name of any bundle file on disk.


=Shrink a Sparse Disk=
=Add Block Storage to Guest=


==External==
Shut down the guest.


* https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1001934
Then Virtual Machine Library -> Guest in question -> Settings -> Hard Disk -> Add Device -> New Hard Disk -> Add -> Adjust disk size.  


==Procedure==
Optionally - Pre-allocate disk space and don't split into multiple files, we we want performance.


<font color=red>TODO: "Clean Up Virtual Machine"</font>
The new disk will be available as a block device under OS. On Linux, use [[lsblk]] to list it.


=Rename VM Bundle Files=
<syntaxhighlight lang='bash'>
[root@vmware-docker ~]# lsblk
NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  10G  0 disk
├─sda1  8:1    0  156M  0 part /boot/efi
├─sda2  8:2    0  512M  0 part /boot
└─sda3  8:3    0  9.4G  0 part /
sdb      8:16  0  50G  0 disk
sr0    11:0    1 55.2M  0 rom
</syntaxhighlight>


{{Warn|This is an experimental procedure. It worked, but it is probably not supported. If not applied, a VM can be cloned but the underlying [[VMware_Fusion_Concepts#VM_Bundle|bundle files]] won't be renamed.}}
=Shrink a Sparse Disk=


Start by renaming the top level directory so its name coincides with the new name of the VM.
==External==


Rename bundle files as follows:
* https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1001934


<pre>
==Procedure==
old="old-name"; new="new-name"; for i in ${old}*; do mv ${i} ${i/${old}/${new}}; done
</pre>


Change the sparse disk extent description. Open <new-name>.vmdk, where <new-name>.vmdk is referred from the vmx file, in vi and:
<font color=red>TODO: "Clean Up Virtual Machine"</font>


<pre>
=Snapshot Consolidation=
:1,$s/old-name/new-name/g
</pre>


Update the snapshot file *. vmsd. Use same command in vi.
{{External|https://kb.vmware.com/kb/1020000}}
 
Update the .vmx and .vmxf configuration files. Use same command in vi.


Remove old logs:
=Command-Line Virtual Machine Operations=


<pre>
{{Internal|VMware Fusion Command Line Virtual Machine Operations|Command-Line Virtual Machine Operations}}
rm vmware*.log
</pre>


=Snapshot Consolidation=
=Set Up Direct Access to Virtualization Host Storage=


{{External|https://kb.vmware.com/kb/1020000}}
A pre-requisite for accessing shared host storage in the VM is to install VMWare Tools in the VM. This is the procedure to install VMWare Tools for Linux and [[Windows_Installation#Install_VMware_Tools_in_a_Windows_Virtual_Machine|this is the procedure to install VMware Tools for Windows]].


=New VMware Fusion Virtual Machine=
Settings for the VMware VM -> Sharing -> Enable Shared Folders -> + -> Select the local folder to share.


{{Internal|New VMware Fusion Virtual Machine|New VMware Fusion Virtual Machine}}
The folder will be available after reboot as "Shared Folders (\\wmware-host)".

Latest revision as of 02:41, 5 August 2018

Internal

New VMware Virtual Machine Provisioning

VMware Fusion Virtual Machine Provisioning

VMware Virtual Machine Cloning

Clone a VMware Fusion Virtual Machine

Rename VM Bundle Files

Rename VM Bundle Files

Changing the Number of CPUs Allocated to a VM

Virtual Machine -> Settings -> System Settings row -> Processors & Memory -> Processors.

Rename a VM

External

Procedure

After startup, Virtual Machine -> Settings -> General -> Click the existing name of the VM to edit the text -> Rename and click outside the text box to save.

Shutdown.

Note that renaming the VM does not change the name of any bundle file on disk.

Add Block Storage to Guest

Shut down the guest.

Then Virtual Machine Library -> Guest in question -> Settings -> Hard Disk -> Add Device -> New Hard Disk -> Add -> Adjust disk size.

Optionally - Pre-allocate disk space and don't split into multiple files, we we want performance.

The new disk will be available as a block device under OS. On Linux, use lsblk to list it.

[root@vmware-docker ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   10G  0 disk
├─sda1   8:1    0  156M  0 part /boot/efi
├─sda2   8:2    0  512M  0 part /boot
└─sda3   8:3    0  9.4G  0 part /
sdb      8:16   0   50G  0 disk
sr0     11:0    1 55.2M  0 rom

Shrink a Sparse Disk

External

Procedure

TODO: "Clean Up Virtual Machine"

Snapshot Consolidation

https://kb.vmware.com/kb/1020000

Command-Line Virtual Machine Operations

Command-Line Virtual Machine Operations

Set Up Direct Access to Virtualization Host Storage

A pre-requisite for accessing shared host storage in the VM is to install VMWare Tools in the VM. This is the procedure to install VMWare Tools for Linux and this is the procedure to install VMware Tools for Windows.

Settings for the VMware VM -> Sharing -> Enable Shared Folders -> + -> Select the local folder to share.

The folder will be available after reboot as "Shared Folders (\\wmware-host)".