VMware Photon on VMware Workstation

VMware Photon is a lightweight OS used for cloud-native workloads. The Photon OS is also designed to host Docker for containerized workloads. Able to run within a vSphere environment and can also be easily run within within VMware Workstation for testing.

1. Download the OVA image from the Photon Github site https://github.com/vmware/photon/wiki/Downloading-Photon-OS
2. In VMware Workstation click File – Open and navigate to the OVA image
3. Name the VM and specify the storage and click Import
4. Accept the EULA
5. Upon completion of the import process edit VM settings
6. Select the options tab and click General, set Guest Operating System to Linux and Version to VMware Photon 64-Bit
7. Power on VM
8. Log in at the VM console and you will be required to update the root password – (Username – root / Password – changeme)
9. Open the docker.service file (/etc/systemd/system/multi-user.target.wants/docker.service)
10. Update “ExecStart=/bin/docker” to “ExecStart=/bin/docker -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -s overlay”
11. Enable and start Docker by running systemctl enable docker && systemctl start docker
12. Start the Portainer container – docker run -d -p 9000:9000 portainer/portainer -H tcp://REMOTE_HOST:REMOTE_PORT
13. In a browser, navigate to the Portainer interface – http://REMOTE_HOST:REMOTE_PORT
14. Enter the default username (admin) and enter and confirm a new password

https://vmware.github.io/photon/
http://www.doublecloud.org/2015/05/how-to-enable-remote-management-for-docker-in-vmware-photon/
https://portainer.readthedocs.io/en/latest/deployment.html

Move Hyper-V VM and Storage Files to New Location

The following script will move all of the VMs on a Hyper-V host to a new storage location. In this case we are moving the VMs from “C:\VM\VirtualMachines\” to “D:\VM\VirtualMachines\.” This script assumes that the VM disks are kept in the VM folder and not in a separate location.

$VMs=Get-VM
$Path="D:\VM\VirtualMachines\$($VM.Name)"

foreach ($VM in $VMs)
    {
    Move-VMStorage -VM $(Get-VM $VM.Name) -DestinationStoragePath $Path
    }

PowerShell to Create Multiple Hyper-V VMs

I’ve created the exact same lab a dozen times with the same three Linux hosts. It’s time to automate the process with a script. The scripts assume that the virtual switches are already created, although their creation or a check to verify their existence could easily be added.

The first host, RT-ISP-01, is a router that has one interface on the connected to the “External” switch for access to the Internet and an interface on the “Network A” and “Network B” private switches. The other two hosts, SVR-A-01 and SVR-B-01, are attached to the “Network A” and “Network B” respectively.

Each host gets 512MB of RAM and a single 40GB hard drive.

The initial setup of these Linux hosts require that legacy interfaces are used at first. The script removes the default interface and adds the appropriate legacy interfaces.

Each host has its DVD drive configured to contain the Linux install ISO so that it is ready to go when the host is started. Continue reading “PowerShell to Create Multiple Hyper-V VMs”