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中引入虚拟 ...
随机推荐
- QQ视频直播架构及原理 流畅与低延迟之间做平衡 音画如何做同步?
QQ视频直播架构及原理 - tianyu的专栏 - CSDN博客 https://blog.csdn.net/wishfly/article/details/53035342 作者:王宇(腾讯音视频高 ...
- z waiting to receive.**B0100000023be50
[root@b ~]# rz▒z waiting to receive.**B0100000023be50
- 0504-Hystrix保护应用-Hystrix Dashboard的使用与常见问题总结
一.概述 Hystrix的主要优势之一是它收集的每个HystrixCommand的度量集合. Hystrix仪表板以高效的方式显示每个断路器的运行状况. 以前查看通过http://localhost: ...
- 006-虚拟机中centos7实现nat静态ip上网
1.设置虚拟机网卡VMnet8 2.修改虚拟机参数 (1).点击编辑-->虚拟网络编辑器,如下图设置 (2)nat设置如下[使用默认即可,记住网关.掩码等,非常重要,因为在centos里面要设置 ...
- linux一路填坑...
1.安装ubuntu 从ubuntu9.0开始,一路更新,越来越垃圾,更可恶的是工作上经常指定特定的版本,于是乎,我电脑里装了n个版本的ubuntu. Win7 + Ubuntu 15.10 1)装完 ...
- 清华教授谈人工智能:BAT还算不上伟大公司
- django基础2: 路由配置系统,URLconf的正则字符串参数,命名空间模式,View(视图),Request对象,Response对象,JsonResponse对象,Template模板系统
Django基础二 request request这个参数1. 封装了所有跟请求相关的数据,是一个对象 2. 目前我们学过1. request.method GET,POST ...2. reques ...
- Delphi 正则表达式语法(7): 匹配转义字符
Delphi 正则表达式语法(7): 匹配转义字符 // ? 号的意义是匹配 0-1 次, 如果需要匹配 ? 怎么办 var reg: TPerlRegEx; begin reg := TPe ...
- 【转】解决Gradle报错找不到org.gradle.api.internal.project.ProjectInternal.getPluginManager()方法问题
源地址:http://www.mamicode.com/info-detail-1178200.html 一.概述 因为本地的AndroidStudio很久没用了,所以想要研究下github上的某个代 ...
- CodeForces - 987D Fair (BFS求最短路)
题意:有N个城市,M条双向道路连接两个城市,整个图保证连通.有K种物品,但每个城市只有一种,现在它们都需要S种物品来举办展览,可以去其他城市获取该城市的物品,花费是两城市之间的最短路径长度.求每个城市 ...