Tag Archives: Hyper-V

Topic 26 – Introduction to Cloud Computing

Why do I need to learn about cloud computing?

Because you will develop software systems that usually leverage cloud services for quick deployment or scalable computation or storage.

What can I do after finishing learning cloud computing?

You will be able to

  • deploy software systems to public clouds,
  • build your private cloud,
  • develop software using cloud plaftforms,
  • develop software using cloud services,
  • leverage cloud services for training and deploying machine learning models,
  • leverage cloud services for big data analytics and reporting.

What should I do now?

Please read
– this Dan C. Marinescu (2022). Cloud Computing – Theory and Practice. Morgan Kaufmann book, and
– this Andreas Wittig and Michael Wittig (2022). Amazon Web Services in Action. Manning Publications book, and
– this Nick Marshall et al. (2019). Mastering VMware vSphere 6.7. Sybex book, and
– this Rakesh Gupta (2020). Salesforce Platform App Builder Certification – A Practical Study Guide. Apress book, and
– this Philip Weinmeister (2019). Practical Salesforce Development Without Code – Building Declarative Solutions on the Salesforce Platform. Apress book, and
– this Tomasz Wiktorski (2019). Data-Intensive Systems – Principles and Fundamentals using Hadoop and Spark. Springer book.

Terminology Review:

  • Software as a Service
  • Multitenancy
  • Infrastructure as a Service
  • Virtual Machines
  • Software-Defined Networking
  • Infrastructure as Code (IaC)
  • Platform as a Service
  • Containers as a Service
  • Function as a Service (Serverless Computing)
  • File Storage
  • Block Storage
  • Object Storage
  • Direct-Attached Storage (DAS)
  • Network-Attached Storage (NAS)
  • Storage Area Network (SAN)
  • GFS
  • Bigtable
  • MapReduce

After finishing learning about cloud computing please click Topic 27 – Introduction to Block Chain to continue.

 

How to Run Docker on a Windows 10 Hyper-V Virtual Machine

Motivation:

You want to have an environment with Docker for development and testing  without interfering your stable machine.

Context:

You have enabled Hyper-V, created a virtual machine and install Windows 10 to the virtual machine.
When installing Docker in the virtual machine, Docker requires that the Nested Virtualization feature must be enabled for the virtual machine.
You open PowerShell, execute below command in the virtual machine:

Get-ComputerInfo -property "HyperV*"

You find that find that the HyperVRequirementVirtualizationFirmwareEnabled feature is not available.

Procedure:

1. Download this PowerShell script. The main interesting command in this script is the command below that enables Nested Virtualization for a virtual machine.

On the host machine execute below command:

Set-VMProcessor -VMName $vmName -ExposeVirtualizationExtensions $true

2. Open PowerShell as Administrator and execute 2 commands below.

Set-ExecutionPolicy -ExecutionPolicy "Unrestricted"
.\Enable-NestedVm.ps1 "Windows 10 Dev"

"Windows 10 Dev" is the virtual machine name without quotes.

3. Install Docker. Restart the virtual machine.

4. Install any additional software if needed, restart the virtual machine again.

5. Open a Command Prompt and test Docker installation.

docker pull hello-world && docker run hello-world

Rerun the command if you get an issue in the first run.

 

 

How to Enable Processor Resource Controls in Hyper-V

Context:

You got a warning message below when configuring Number of virtual processors in Hyper-V.

Hyper-V is not configured to enable processor resource controls.

Problem:

How do you enable processor resource controls in Hyper-V?

Solution:

1. What is the difference between core and logical processor?

  • A socket is a slot contains one or more mechanical components providing mechanical and electrical connections between a microprocessor and a printed circuit board (PCB). This allows for placing and replacing the central processing unit (CPU) without soldering.
  • A core is a physical processor unit (hardware component) inside your processor.
  • Logical processor or logical core is the processor as seen by the operating system. Logical processor does not exist physically.

Logical Processor = (# of Core) * (# of Thread in each Core) = 4 * 2 = 8

Example:

2. What is SMT?

Simultaneous multithreading, or SMT, is a technique utilized in modern processor designs that allows the processor’s resources to be shared by separate, independent execution threads.

Processors supporting SMT are available from both Intel and AMD. Intel refers to their SMT offerings as Intel Hyper Threading Technology, or Intel HT.

3. How does Hyper-V virtualize processors?

  • Hyper-V creates and manages virtual machine partitions, across which compute resources are allocated and shared, under control of the hypervisor. Partitions provide strong isolation boundaries between all guest virtual machines, and between guest VMs and the root partition.
  • The root partition is itself a virtual machine partition, although it has unique properties and much greater privileges than guest virtual machines. The root partition provides the management services that control all guest virtual machines, provides virtual device support for guests, and manages all device I/O for guest virtual machines. Microsoft strongly recommends not running any application workloads in the root partition.
  • Each virtual processor (VP) of the root partition is mapped 1:1 to an underlying logical processor (LP). A host VP always runs on the same underlying LP – there is no migration of the root partition’s VPs.
  • By default, the LPs on which host VPs run can also run guest VPs.
  • A guest VP may be scheduled by the hypervisor to run on any available logical processor. While the hypervisor scheduler takes care to consider temporal cache locality, NUMA topology, and many other factors when scheduling a guest VP, ultimately the VP could be scheduled on any host LP.

4. What are Hyper-V hypervisor scheduler types?

Starting with Windows Server 2016, the Hyper-V hypervisor supports several modes of scheduler logic, which determine how the hypervisor schedules virtual processors on the underlying logical processors. These scheduler types are:

  • The classic scheduler provides a fair share, preemptive round- robin scheduling model for guest virtual processors.
  • The core scheduler offers a strong security boundary for guest workload isolation, and reduced performance variability for workloads inside of VMs that are running on an SMT-enabled virtualization host.
  • The root scheduler cedes control of work scheduling to the root partition. The NT scheduler in the root partition’s OS instance manages all aspects of scheduling work to system LPs.

5. Determine your current Hyper-V Hypervisor Scheduler Type

Execute the command below.

Get-WinEvent -FilterHashTable @{ProviderName="Microsoft-Windows-Hyper-V-Hypervisor"; ID=2} -MaxEvents 1

  • 1 = Classic scheduler, SMT disabled
  • 2 = Classic scheduler
  • 3 = Core scheduler
  • 4 = Root scheduler

6. Enable processor resource controls in Hyper-V by setting Scheduler Type to Core or Classic.

  • Open a Command Prompt as Administrator.
  • Execute the command below.
C:\Windows\System32\bcdedit.exe /set hypervisorschedulertype Core

  • Restart the computer.

 

 

How to Install Intel HAXM in a Machine with Hyper-V

Problem:

Intel HAXM helps speeding up Android emulators. However it cannot work in parallel with Hyper-V.

You want to install Intel HAXM without removing Hyper-V.

Solution:

Use the steps below to temporarily turn Hyper-V off to install Intel HAXM and launch Android Studio emulators.

  1. Open a Command Prompt or PowerShell as Admin
  2. Execute the command below to turn Hyper-V off
bcdedit /set hypervisorlaunchtype off

3. Restart your computer.

4. Install Intel HAXM

sdk

\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm-android.exe
where

sdk

 is the location of Android SDK.

5. Verify Intel HAXM installation

sc query intelhaxm

To turn Hyper-V on again, use the steps below:

  1. Open a Command Prompt or PowerShell as Admin
  2. Execute the command below to turn Hyper-V off
bcdedit /set hypervisorlaunchtype auto start

3. Restart your computer.