惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google Online Security Blog
Google Online Security Blog
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
阮一峰的网络日志
阮一峰的网络日志
L
Lohrmann on Cybersecurity
Security Latest
Security Latest
博客园 - 【当耐特】
Microsoft Security Blog
Microsoft Security Blog
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
The Register - Security
The Register - Security
T
Tenable Blog
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
有赞技术团队
有赞技术团队
C
CXSECURITY Database RSS Feed - CXSecurity.com
Simon Willison's Weblog
Simon Willison's Weblog
S
Schneier on Security
Scott Helme
Scott Helme
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
H
Hackread – Cybersecurity News, Data Breaches, AI and More
K
Kaspersky official blog
Know Your Adversary
Know Your Adversary
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
Spread Privacy
Spread Privacy
P
Proofpoint News Feed
博客园 - 聂微东
NISL@THU
NISL@THU
T
Threat Research - Cisco Blogs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
A
Arctic Wolf
V2EX - 技术
V2EX - 技术
H
Heimdal Security Blog
C
Check Point Blog
D
DataBreaches.Net
H
Help Net Security
www.infosecurity-magazine.com
www.infosecurity-magazine.com
L
LangChain Blog
宝玉的分享
宝玉的分享
V
Vulnerabilities – Threatpost
PCI Perspectives
PCI Perspectives
Recent Announcements
Recent Announcements
Martin Fowler
Martin Fowler

博客园 - 愚公

Bridges 虚拟化浪潮 MAGEUI的Hash问题 Lingoes的划词翻译功能极有可能泄露隐私 VSTO SaveCopyAs方法在Excel 2007下必须注意的一个问题 Vista Folders Always Shown In Details View - 让Vista文件夹总是使用详细资料视图 用7zip制作自动解压安装程序 安装新的Oracle Instant Client后重新配置PL/SQL Developer和环境: Certificates registry key name to MMC friendly name mapping A review of the CVS SCC PLUGIN IE8.0 TAB行为悄然改善: WSS 3.0 List WebService使用点滴 Set a password textbox for Visual Studio .NET setup project 在WinForm中控制GIF动画的启停的一种方法 foobar2000绿色版在vista下的Unhandled exception: Bad allocation NTFS文件及目录日期值行为 installState is missing ! .Net Framework 2.0配置工具Stopped Working VISTA BITS POLICY DESCRIPTION'S MISTAKE
Virtual Server启动时自动启动每个虚机
愚公 · 2007-03-20 · via 博客园 - 愚公

On Error Resume Next

Set virtualServer = CreateObject("VirtualServer.Application")
set vmCollection = virtualServer.VirtualMachines
For Each vm in vmCollection
    Wscript.Echo 
"=============================="
    Wscript.Echo 
"Name: " & vm.Name
    Wscript.Echo 
"Notes: " & vm.Notes
    Wscript.Echo
    Wscript.Echo 
"Configuration File: " & vm.File
    Wscript.Echo
    Wscript.Echo 
"Memory: " & vm.Memory & "M"
    Wscript.Echo
    WScript.Echo 
"State: " & VM.State
    
If vm.State=1 or vm.State=2 Then 'Off and saved
       Wscript.Echo "Auto Startup "
       vm.Startup
       WScript.Sleep WScript.Arguments(
0& "000"
       WScript.Echo 
"New State: " & VM.State
    
End If
    Wscript.Echo 
"=============================="
Next

在Virtual Server的Server Properties中Enable scripts attached to this server

并在Command-line action when Virtual Server starts:中填入:
cscript AutoStart.vbs 15

这个15是每个虚机启动的延时秒数,因为如果不延时,就会发生N个虚机一窝蜂同时启动,给主机的带来巨大的负担。

另外,在每个虚机的General properties配置里,应该选中Run virtual machine under the following user account:,并指定一个可以在本地登录的用户账户名及口令,这个账户建议使用最小权限的账户,一般能够读写和执行虚机定义及虚拟盘文件即可(详细权限要求请查阅Virtual Server Administrator's Guide),不指定这个账户将无法运行脚本。
虽然,就在这个地方我们可以设置自动启动及启动的延时,但每次增减虚机时时还要查看现有的设置情况,以决定错开启动的延迟时间,比较麻烦,有了这个脚本你可以一劳永逸,稍作修改还可以实现更复杂的逻辑。