Sample Code class Equipment { class FloppyDisk : public Equipment { public: public: virtual ~Equipment( ); FloppyDisk(const char*); const char* name( ) { return _name; } virtual ~FloppyDisk( ); virtual Watt Power( ); virtual Watt Power( ); virtual Currency NetPrice( ); virtual Currency NetPrice( ); virtual Currency DiscountPrice( ); virtual Currency DiscountPrice( ); virtual void Add(Equipment *); virtual void Remove(Equipment *); } class Chassis : public CompositeEquipment{ virtual Iterator * CreateIterator( ); public: protected: Chassis (const char* ); Equipment (const char * ); virtual ~Chassis( ); private: virtual Watt Power( ); const char * _name; virtual Currency NetPrice( ); } virtual Currency DiscountPrice( ); }
View full slide show




Static vs. Dynamic Binding Example Class Attributes Shape Methods - virtual computeArea - virtual computeVolume - pure virtual printShapeName - pure virtual print Point x y - virtual printShapeName - virtual print - constructor - setPoint - getX - getY Circle radius - virtual printShapeName - virtual print - virtual computeArea - setRadius - getRadius - constructor Cylinder height - virtual printShapeName - virtual print - virtual computeArea - virtual computeVolume - setHeight - getHeight - constructor CMSC 202 5
View full slide show




Hyper-V Manager Configuration Options (cont’d.) • Manage specific virtual machine from the right pane – Options depend on if the virtual machine is started • Configuring Virtual Networking Options – Virtual network • Network on which virtual machines communicate through virtual links – Virtual networking options using Hyper-V Manager’s Virtual Network Manager • External virtual network • Internal virtual network • Private virtual network MCITP Guide to Microsoft Windows Server 2008, Server Administration (Exam #70-646) 38
View full slide show




Memory Virtualization Basics  In ESX, the address translation between guest physical memory and host physical memory is maintained by the hypervisor using a physical memory mapping data structure, or pmap, for each virtual machine.  The shadow page tables maintain consistency with the guest virtual to guest physical address mapping in the guest page tables and the guest physical to host physical address mapping in the pmap data structure.  This approach removes the virtualization overhead for the virtual machine’s normal memory accesses because the hardware TLB will cache the direct guest virtual to host physical memory address translations read from the shadow page tables.  The hypervisor intercepts the virtual machine’s memory accesses and allocates host physical memory for the virtual machine on its first access to the memory. In order to avoid information leaking among virtual machines, the hypervisor always writes zeroes to the host physical memory before assigning it to a virtual machine.  The hypervisor knows when to allocate host physical memory for a virtual machine because the first memory access from the virtual machine to a host physical memory will cause a page fault that can be easily captured by the hypervisor.
View full slide show




AAVirtual Virtual Organization Organization
View full slide show




Principle of Virtual Work The virtual displacement ui = {u, v, w} of a material point is a fictitious displacement such that the forces acting on the point remain unchanged. The work done by these forces during the virtual displacement is called the virtual work. U T Virtual Strain Energy  ij eij dV V  ( x ex   y e y   z ez   xy xy   yz yz   zx zx )dV V W Virtual Work Done by Surface and Body Forces  Ti n ui dS   Fi ui dV St V Virtual Strain Energy = Virtual Work Done by Surface and Body Forces n   e dV  T ij ij i   ui dS   Fi ui dV V St V Change in Potential Energy (UT-W) During a Virtual Displacement from Equilibrium is Zero.  U dV   V n T i  ui dS  St  U  W  0 F u dV i i T V 
View full slide show




Memory Virtualization Basics  The virtual memory space, that is the guest’s memory space, is divided into blocks, typically 4KB, called pages. The physical memory, that is the host’s memory, is also divided into blocks, also typically 4KB (ESX/ESXi also provides support for large pages of 2 MB)  When host physical memory is full, the data for virtual pages that are not present in host physical memory are stored on disk.  When running a virtual machine, the hypervisor creates a contiguous addressable memory space for the virtual machine. This allows the hypervisor to run multiple virtual machines simultaneously while protecting the memory of each virtual machine from being accessed by others.  From the view of the application running inside the virtual machine, the hypervisor adds an extra level of address translation that maps the guest physical address to the host physical address. As a result, there are three virtual memory layers in ESX: guest virtual memory, guest physical memory, and host physical memory.
View full slide show




1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 // Fig. 10.12: shape.h // Shape abstract-base-class definition. #ifndef SHAPE_H #define SHAPE_H #include Outline shape.h (1 of 1) // C++ standard string class using std::string; class Shape { public: Virtual and pure virtual functions. // virtual function that returns shape area virtual double getArea() const; // virtual function that returns shape volume virtual double getVolume() const; // pure virtual functions; overridden in derived classes virtual string getName() const = 0; // return shape name virtual void print() const = 0; // output shape }; // end class Shape #endif  2003 Prentice Hall, Inc. All rights reserved. 40
View full slide show




Installing Windows Server 2008 as a Virtual Machine • Use the New Virtual Machine Wizard – Specify: • Amount of RAM to allocate to the virtual machine • Network interface to use for the virtual machine • Virtual disk to use • Activity 11-2: Installing Windows Server 2008 as a Virtual Machine in Hyper-V – Objective: Learn how to create a virtual machine and install Windows Server 2008 in that virtual machine MCITP Guide to Microsoft Windows Server 2008, Server Administration (Exam #70-646) 29
View full slide show




Ballooning: Inflating the balloon in a virtual machine  If any of these pages are re-accessed by the virtual machine for some reason, the hypervisor will treat it as a normal virtual machine memory allocation and allocate a new host physical page for the virtual machine.  When the hypervisor decides to deflate the balloon—by setting a smaller target balloon size—the balloon driver deallocates the pinned guest physical memory, which releases it for the guest’s applications.  By inflating the balloon, a virtual machine consumes less physical memory on the host, but more physical memory inside the guest. As a result, the hypervisor offloads some of its memory overload to the guest operating system while slightly loading the virtual machine. That is, the hypervisor transfers the memory pressure from the host to the virtual machine.  Ballooning induces guest memory pressure. In response, the balloon driver allocates and pins guest physical memory. The guest operating system determines if it needs to page out guest physical memory to satisfy the balloon driver’s allocation requests.  If the virtual machine has plenty of free guest physical memory, inflating the balloon will induce no paging and will not impact guest performance.
View full slide show




ESX Memory Allocation Management  Example: Now say the shares setting on 1 VM is changed to “High”, which results in this VM receiving 40,000 shares (20 * 2,000) instead of 20,000. The sum of all shares is now increased to 120,000. This VM will receive 40,000/120,000 = 1/3rd of the resources available. Thus 4,000/3 = 1333 MB. All the other 4 VMs will receive only 20,000/120,000 = 1/6th of the available resources = 4,000/6 = 666 MB each.  A significant limitation of the pure proportional-share algorithm is that it does not incorporate any information about the actual memory usage of the virtual machine. As a result, some idle virtual machines with high shares can retain idle memory unproductively, while some active virtual machines with fewer shares suffer from lack of memory.  ESX resolves this problem by estimating a virtual machine’s working set size and charging a virtual machine more for the idle memory than for the actively used memory through an idle tax.  A virtual machine’s shares-per-allocated page ratio is adjusted to be lower if a fraction of the virtual machine’s memory is idle. Hence, memory will be reclaimed preferentially from the virtual machines that are not fully utilizing their allocated memory.
View full slide show




I/O Virtualization  I/O Virtualization involves managing the routing of I/O requests between virtual devices and the shared physical hardware.  The hypervisor virtualizes the physical hardware and presents each virtual machine with a standardized set of virtual devices.  These virtual devices effectively emulate well-known hardware (with device drivers) and translate the virtual machine requests to the system hardware.  This standardization on consistent device drivers also helps with virtual machine standardization and portability across platforms as all virtual machines are configured to run on the same virtual hardware regardless of the actual physical hardware in the system.
View full slide show




MEMORY & I/O SYSTEMS Virtual Memory • Virtual addresses – – – – Programs use virtual addresses Entire virtual address space stored on a hard drive Subset of virtual address data in DRAM CPU translates virtual addresses into physical addresses (DRAM addresses) – Data not in DRAM fetched from hard drive • Memory Protection – – – – Each program has own virtual to physical mapping Two programs can use same virtual address for different data Programs don’t need to be aware others are running One program (or virus) can’t corrupt memory used by another Chapter 8 <47>
View full slide show




/** @file BagInterface.h */ # ifndef _BAG_INTERFACE # define _BAG_INTERFACE # include < vector > template < class ItemType > class BagInterface { public: /** Gets the current number of entries in this bag. @return The integer number of entries currently in the bag. */ virtual int getCurrentSize () const = 0; /** Sees whether this bag is empty. @return True if the bag is empty, or false if not. */ virtual bool isEmpty () const = 0; /** Removes all entries from this bag. @post Bag contains no items, and the count of items is 0. */ virtual void clear () = 0; /** Counts the number of times a given entry appears in bag. @param anEntry The entry to be counted. @return The number of times anEntry appears in the bag. */ virtual int getFrequencyOf (const ItemType & anEntry) const = 0; /** Adds a new entry to this bag. @post If successful, newEntry is stored in the bag and the count of items in the bag has increased by 1. @param newEntry The object to be added as a new entry. @return True if addition was successful, or false if not. */ virtual bool add (const ItemType & newEntry) = 0; /** Tests whether this bag contains a given entry. @param anEntry The entry to locate. @return True if bag contains anEntry, or false otherwise. */ virtual bool contains (const ItemType & anEntry) const = 0; /** Removes one occurrence of a given entry from this bag, if possible. @post If successful, anEntry has been removed from the bag and the count of items in the bag has decreased by 1. @param anEntry The entry to be removed. @return True if removal was successful, or false if not. */ virtual bool remove (const ItemType & anEntry) = 0; /** Empties and then fills a given vector with all entries that are in this bag. @return A vector containing all the entries in the bag. */ virtual vector < ItemType > toVector () const = 0; } ; // end BagInterface
View full slide show




ASYNCHRONOUS TRANSFER MODE VPI VCI PTI CLP HEC Payload The The Virtual Virtual Path Path Identifier Identifier (VPI) (VPI) specifies specifies the the number number of of aa particular particular path path that that several several virtual virtual circuits circuits take take through through the the network network node; node; by by hierarchically hierarchically identifying identifying such such routes, routes, individual individual nodes nodes may may just just use use this this prefix prefix to to forward forward aa cell, cell, rather rather than than having having to to examine examine the the entire entire path/circuit path/circuit sequence. sequence. The The Virtual Virtual Circuit Circuit Identifier Identifier (VCI) (VCI) completes completes the the identification identification of of the the particular particular virtual virtual circuit circuit being being used. used. The The Payload Payload Type Type Identifier Identifier (PTI) (PTI) signifies signifies the the sort sort of of data data being being transmitted: transmitted: •• 000 000 and and 001 001 signify signify uncongested uncongested user user data data cells cells (with (with aa Final Final bit bit on on the the end). end). •• 010 010 and and 011 011 signify signify congested congested user user data data cells cells (with (with aa Final Final bit bit on on the the end). end). •• 100 100 and and 101 101 signify signify maintenance maintenance info info (locally (locally or or end-to-end). end-to-end). •• 110 110 signifies signifies the the cell cell is is relaying relaying end-to-end end-to-end congestion congestion info. info. The The Cell Cell Loss Loss Priority Priority (CLP) (CLP) bit bit is is used used to to distinguish distinguish highhigh- and and low-priority low-priority traffic. traffic. The The Header Header Error Error Check Check (HEC) (HEC) byte byte is is aa CRC CRC remainder remainder for for just just the the header. header. The The 48-byte 48-byte Payload Payload includes includes the the data data and and any any AAL AAL (ATM (ATM Adaptation Adaptation Layer) Layer) headers headers that that might might have have been been added added at at the the protocol protocol layer layer above above ATM. ATM. CS Chapter 5 Page 14
View full slide show




Sample Code for Composite Example class CompositeEquipment: public Equipment { public: virtual ~CompositeEquipment( ); An implementation of NetPrice( ) Currency CompositeEquipoment::NetPrice( ) { virtual Watt Power( ); Iterator * i = CreateIterator( ); virtual Currency NetPrice( ); Currency total = 0; virtual Currency DiscountPrice( ); for (i -> first( ); i -> isDone( ); i -> next( ) ) { virtual void Add(Equipment *); total += i -> currentItem( ) -> NetPrice( ); virtual void Remove(Equipment *); } virtual Iterator * CreateIterator( ); delete i; protected: CompositeEquipment(const char *); private: List _equipment; } return total; }
View full slide show




Virtual Function  A member of a class that can be redefined in its derived classes is known as a virtual member. — precede its declaration with the keyword virtual  Once a method is declared as virtual, it is virtual in all derived classes too.  Destructors should always be virtual! (See example)  Constructors are never virtual! Why?
View full slide show




DDN | SFA10KE™ With iRODS and GridScaler parallel filesystem Reading data via parallel paths with Reading data via parallel paths with An An iRODS iRODS rule rule requires requires that that DDN DDN || GRIDScaler GRIDScaler embedded embedded in in the the system. system. iRODS a copy of the data is sent to a copy of the data is sent to are Writing result of the processing Faster access->faster processing>faster results Writing the the result ofbuilt-in the processing Clients sending data to the Faster access->faster processing>faster results clients Clients are sending data to the built-in a remote iRODS server Compute a remote iRODS serveriRODS server. iRODS server. Computing Remote iRODS server cluster All All of of this this happened happened because because of of a a few few rules rules in in iRODS iRODS that triggered Start processing that triggered on on the the incoming data. data. DDNincoming DDN DDN iRODS/iCAT GRIDScaler NSD GRIDScaler NSD GRIDScaler NSD In other In server other words, words, the the incoming incoming data data drives drives the the processing. processing. DDN After another After the the conversion conversion another MicroService MicroService iRODS iRODS was was configured configured with with a a rule rule to to GRIDScaler submits a processing job on the cluster to submits a processing job on the cluster to convert the orange ball into Client Here is a configuration convert theiRODS orangefor ball into a a purple purple one. one. with datamanagement Here is a configuration with iRODS for datamanagement process the uploaded and pre-processed data process the uploaded and pre-processed data Virtual Machine 5 Virtual Machine 6 Virtual 7on theVirtual Machineitself 8 Note that this is Machine doneData storage and GridScaler for fast scratch space. can come in and GridScaler for fast scratch space. Data can come in Virtual Machine 1 Virtual Machine 2 Virtual Machine 3 Virtual Machine 4 from clients or devices such as sequencers. from clients or devices such as Massive throughput tosequencers. Meta data backend storage Registering the data with iRODS ddn.com Registering the data iRODS (clickwith to continue) ©2012 DataDirect Networks. All Rights Reserved.
View full slide show




User-Mode Features • VM Manager (virtual machine manager) – User-mode subsystems share memory efficiently – Provides process services to manage virtual memory • • • • • • Allocate memory in two stages Read and/or write protection for virtual memory Lock virtual pages in physical memory Retrieve information about virtual pages Protect virtual pages Rewrite virtual pages to disk Understanding Operating Systems, Fifth Edition 25
View full slide show




Dynamic Binding • Compiler cannot determine binding of object to method • Binding is determined dynamically at runtime • To indicate that a method is to be bound dynamically, must use the reserved word virtual virtual void Write(); // dynamic binding will occur • When a method is defined as virtual, all overriding methods from that point on down the hierarchy must be defined as virtual • A pure virtual method is defined as: virtual void Write() const = 0; • When a class contains a pure virtual method, the class is truly abstract; I.e., it cannot be instantiated CMSC 202 4
View full slide show




Virtual Machines (Cont.)  The virtual-machine concept provides complete protection of system resources since each virtual machine is isolated from all other virtual machines. This isolation, however, permits no direct sharing of resources.  A virtual-machine system is a perfect vehicle for operating-systems research and development. System development is done on the virtual machine, instead of on a physical machine and so does not disrupt normal system operation.  The virtual machine concept is difficult to implement due to the effort required to provide an exact duplicate to the underlying machine Operating System Concepts 2.30 Silberschatz, Galvin and Gagne ©2005
View full slide show




Virtual Memory Mapping Function CPE 631 AM Virtual Address ... 31 10 9 Virtual Page No. 0 ... Offset translation Physical Address 29 ... 10 9 ... 0 Phys. Page No. Offset Use table lookup (“Page Table”) for mappings: Virtual Page number is index  Virtual Memory Mapping Function    24/03/19 Physical Offset = Virtual Offset Physical Page Number (P.P.N. or “Page frame”) = PageTable[Virtual Page Number] UAH-CPE631 12
View full slide show