Pre-Fixup
The manager performs the following pre-fixup tasks before Stage-1 fixup is triggered:
- Create the migrated VM based on the blueprint of the source system with relevant CPU, Memory and Network Adapters (in disconnected state)
- Mount the replica disks starting from SCSI controller 0, port 0 onward. The replica boot disk of the source VM is attached to scsi0:0
- Copy the fixup disk and attach it to scsi0:15
- Change the boot order of the migrated VM to boot from scsi0:15, so the system boots up from fixup disk to perform the Stage-1 fixup
- Power On the migrated VM to trigger Stage-1 fixup
Stage 1 of Fixup
This stage of the fixup is called the out-of-guest fixup and is performed by the HCX-OSAM software stack residing on the fixup disk. Here are the steps performed during Stage-1 fixup:
- Fixup code residing on the fixup disk creates a folder /tmp/fixup; Manager will monitor for the presence of this folder
- Manger will create the following files needed for fixup:
- /tmp/fixup/system-configuration.json; this file contains the system configuration
- /tmp/fixup/replica-disk-map.json; this file contains the replica disk configuration
- /tmp/fixup/network-interface-map.json; this file contains the source NIC mapping to the NICs on the migrated system
- /tmp/fixup/BEGIN; to indicate the fixup code to begin the fixup process
- Fixup code will begin the fixup process by fixing the following:
- Modifying /etc/fstab as needed
- Rebuilding initrd/initramfs image
- Reinstall the boot loader
- Interfaces are renamed as eth0, eth1, etc.. and will be mapped based on the source mac-address
- Modifying /etc/sysconfig/network-scripts/ifcfg-XXX files on RHEL based systems and changing the interface names accordingly
- Modifying /etc/network/interfaces file on Ubuntu based systems and changing the interface names accordingly
- Disk related fixup which include:
- NIC related fixup which include:
- Modify the system to run in single-user mode and add additional code to perform in-guest fixup (or stage-2 fixup)
- During the fixup process, fixup code will create a file /tmp/fixup/progress.txt; which contain all the above actions that fixup code performs
- Once the fixup is complete, fixup code will create the following files:
- /tmp/fixup/fixup.log; this contains the log information that was captured by /tmp/fixup/progress.txt
- /tmp/fixup/result.json; this contains the result of the fixup operation
- /tmp/fixup/END; this indicate the manager that the Stage-1 fixup has completed
Pre Stage 2 of Fixup
The manager upon seeing the /tmp/fixup/END file, performs the following operations:
- Collect the fixup log and result.json file from the migrated VM. The fixup log and result.json are copied on the cloud manager under /common/logs/admin as <mig-id>_fixup.log and <mig-id>_result.json respectively
- Power-off the migrated VM
- Change the boot order of the migrated VM to boot from scsi0:0
- Add the CDROM drive
- Power-On the migrated VM to trigger Stage-2 fixup
- Mount the VMware Tools ISO
Stage 2 of Fixup
- This stage of the fixup is also called the in-guest fixup and is performed by the sentinel software that was installed on the source system. Here are the steps performed during Stage-2 fixup:
- Poll for the presence of VMware Tools ISO
- Install VMware Tools
- Switch the system from single-user mode to original run level as configured on the source system
- The in-guest fixup operations are performed by Sentinel, which makes sure that the migrated system will boot the same as the original system. This is enabled via the various files created by out-of-guest fixup code under /opt/vmware/hcx/osam/data. This include restoring the /etc/inittab, systemd-default-target, selinux-mode etc..
- Delete the in-guest fixup code and uninstall the sentinel
- Power-off the system
OSAM Overview