PowerShell 在hyper-v中创建虚拟机
# This script configures the Hyper-V machines used for the 50331 Course.
# PowerShell 3.0 and Windows Server 2012 or Windows 8 Pro are required to perform this setup
# The C:\ Drive should have at least 200GB of free space available.
# All the files on the 50331 Student CD should be copied to C:\Labfiles before performing this setup.
# Variables
$CLI1 = "test_client" # Name of VM running Client Operating System
$SRV1 = "test_server" # Name of VM running Server Operating System
$CRAM = 4GB # RAM assigned to Client Operating System
$SRAM = 2GB # RAM assigned to Server Operating System
$CLI1VHD = 80GB # Size of Hard-Drive for Client Operating System
$SRV1VHD = 40GB # Size of Hard-Drive for Server Operating System
$VMLOC = "G:\test" # Location of the VM and VHDX files
$NetworkSwitch1 = "vlan_out" # Name of the Network Switch
$W7ISO = "E:\Software\Microsoft\cn_windows_server_2012_r2\cn_windows_server_2012_r2_with_update_x64_dvd_6052725.iso" # Windows 7 ISO
$W7VFD = "G:\Windows_Server_2012\Virtual Hard Disks\Windows_Server_2012.vhdx" # Windows 7 Virtual Floppy Disk with autounattend.xml file
$WSISO = "E:\Software\Microsoft\cn_windows_server_2012_r2\cn_windows_server_2012_r2_with_update_x64_dvd_6052725.iso" # Windows Server 2008 ISO
$WSVFD = "G:\Windows_Server_2012\Virtual Hard Disks\Windows_Server_2012.vhdx" # Windows Server 2008 Virtual Floppy Disk with autounattend.xml file # Create VM Folder and Network Switch
MD $VMLOC -ErrorAction SilentlyContinue
$TestSwitch = Get-VMSwitch -Name $NetworkSwitch1 -ErrorAction SilentlyContinue; if ($TestSwitch.Count -EQ 0){New-VMSwitch -Name $NetworkSwitch1 -SwitchType Private} # Create Virtual Machines
New-VM -Name $CLI1 -Path $VMLOC -MemoryStartupBytes $CRAM -NewVHDPath $VMLOC\$CLI1.vhdx -NewVHDSizeBytes $CLI1VHD -SwitchName $NetworkSwitch1
New-VM -Name $SRV1 -Path $VMLOC -MemoryStartupBytes $SRAM -NewVHDPath $VMLOC\$SRV1.vhdx -NewVHDSizeBytes $SRV1VHD -SwitchName $NetworkSwitch1 # Configure Virtual Machines
Set-VMDvdDrive -VMName $CLI1 -Path $W7ISO
Set-VMDvdDrive -VMName $SRV1 -Path $WSISO
Set-VMFloppyDiskDrive -VMName $CLI1 -Path $W7VFD
Set-VMFloppyDiskDrive -VMName $SRV1 -Path $WSVFD
Start-VM $SRV1
Start-VM $CLI1
PowerShell 在hyper-v中创建虚拟机的更多相关文章
- 如何在VMware中创建虚拟机
今天给大家分享如何在VMware中创建虚拟机,具体的教程如下.在这里小编提前下载了Ubuntu14.04桌面系统,为后面在虚拟机中安装Ubuntu14.04桌面系统做准备. 1.从官网上或者直接百度上 ...
- 使用Powershell在Microsoft Azure中创建Virtual Machine
获取虚拟机镜像 PS C:\WINDOWS\system32> Get-AzureVMImage 仅获得虚拟机名 PS C:\WINDOWS\system32> (Get-AzureVMI ...
- Virsh中创建虚拟机两种方式define和create的区别
本质上两者一样的,都是从xml配置文件创建虚拟机 define 丛xml配置文件创建主机但是不启动 create 同样是丛xml配置文件创建主机,但是可以指定很多选项,比如是否启动,是否连接控制台 ...
- 在Ceph创建虚拟机的过程改进分析
作为个人学习笔记分享.有不论什么问题欢迎交流! 近期在Gerrit中看到一个change:https://review.openstack.org/#/c/94295/ , 它主要是对当前在Ceph中 ...
- Nova创建虚拟机的底层代码分析
作为个人学习笔记分享.有不论什么问题欢迎交流! 在openstack中创建虚拟机的底层实现是nova使用了libvirt,代码在nova/virt/libvirt/driver.py. #image_ ...
- nova创建虚拟机源码分析系列之一 restful api
开始学习openstack源码,源码文件多,分支不少.按照学习的方法走通一条线是最好的,而网上推荐的最多的就是nova创建虚机的过程.从这一条线入手,能够贯穿openstack核心服务.写博文仅做学习 ...
- KVM :vnc 远程控制kvm创建虚拟机
一.vnc远程控制服务器 前期准备: 1.编辑/etc/hosts vi /etc/hosts 10.1.16.32 kvm 2.关闭防火墙 service iptables stop 3.关闭sel ...
- 『学了就忘』Linux基础 — 5、使用VMware创建虚拟机
目录 1.在VMware中创建虚拟机 (1)点击[创建新的虚拟机]. (2)选择系统安装方式 (3)选择客户机操作系统 (4)自定义虚拟机的名称和安装位置. (5)指定系统硬盘容量 (6)完成创建 2 ...
- Istio(十一):向istio服务网格中引入虚拟机
目录 一.模块概览 二.系统环境 三.虚拟机负载 3.1 虚拟机负载 3.2 单网络架构 3.3 多网络架构 3.4 Istio 中如何表示虚拟机工作负载? 四.实战:向istio Mesh中引入虚拟 ...
随机推荐
- convention over configuration 约定优于配置 按约定编程 约定大于配置 PEP 20 -- The Zen of Python
为什么说 Java 程序员必须掌握 Spring Boot ?_知识库_博客园 https://kb.cnblogs.com/page/606682/ 为什么说 Java 程序员必须掌握 Spring ...
- String.prototype.charCodeAt()
w <script> function wf(w) { console.log(w) } var w = 'ABC'.charCodeAt(0); wf(w) var w = '中'.ch ...
- Python计算地图上两点经纬度间的距离
处理地图数据时,经常需要用到两个地理位置间的距离.比如A点经纬度(110.0123, 23.32435),B点经纬度(129.1344,25.5465),求AB两点之间的距离.我们可以用haversi ...
- Cocos2dx3.1-Android环境搭建初体验
初玩Cocos2dx,多多包涵. 感觉版本号之间的差异比較大.相对前面的版本号来说.3.X更easy上手.更方便了. 一.安装python.我的python-2.7.3. 配置环境变量 系统变量里:在 ...
- 采购订单打印并预览PDF
*&---------------------------------------------------------------------* *& Report Z01MMF019 ...
- Rare But Powerful Vim Commands.
@1: We all know about :wq, but we usually ignore :x. :x和:wq都是保存当前文件并退出. 这两个命令实际上并不完全等价,当文件被修改时两个命令时相 ...
- oracle ORA-01704: string literal too long
导出数据时,在SQL拼接处,提示 oracle ORA-01704: string literal too long sql: WITH already_in AS (SELECT distinct ...
- 60. Permutation Sequence(求全排列的第k个排列)
The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the p ...
- Python Tornado框架(ioloop对象分析)
网上都说nginx和lighthttpd是高性能web服务器,而tornado也是著名的高抗负载应用,它们间有什么相似处呢?上节提到的ioloop对象是如何循环的呢?往下看. 首先关于TCP服务器的开 ...
- 再来一道测半平面交模板题 Poj1279 Art Gallery
地址:http://poj.org/problem?id=1279 题目: Art Gallery Time Limit: 1000MS Memory Limit: 10000K Total Su ...