【问题标题】:Cloued group instances, cloud vm instances云组实例、云 vm 实例
【发布时间】:2021-06-01 08:41:52
【问题描述】:

我想制作大量的云 Windows 虚拟机,有没有办法在所有这些虚拟机中安装我的应用程序并运行并登录我的应用程序一次。

例如一个脚本?

【问题讨论】:

标签: google-cloud-platform cloud cloud-hosting


【解决方案1】:

您需要遵循几个步骤来实现这一目标。 第一步是创建自定义Windows Server images

您可以从现有的 Compute Engine Windows Server 映像创建自定义的 Windows Server 映像。使用这些自定义映像创建具有与现有实例相同的启动磁盘映像的实例。 在创建镜像之前,您需要installGCESysprep 准备您的系统进行复制,您也可以在创建镜像之前安装您想要的所有程序。

然后你可以使用下面的命令来创建你的镜像:

gcloud compute images create example-image --source-disk [DISK_NAME] \
    --source-disk-zone [ZONE] \
    --storage-location [LOCATION] \
    [--force]

一旦你有了你的形象,你就可以创建你的Instance Template。 在这部分过程中,您可以使用唯一的、特定于 Windows 的元数据键添加 Start-up Sript

每个元数据键必须与您要运行的脚本类型相匹配。

Type of script During GCESysprep & Before boot After GCESysprep completes & On every subsequent boot
url startup scripts sysprep-specialize-script-url windows-startup-script-url
cmd startup scripts sysprep-specialize-script-cmd windows-startup-script-cmd
bat startup scripts sysprep-specialize-script-bat windows-startup-script-bat
ps1 startup scripts sysprep-specialize-script-ps1 windows-startup-script-ps1

然后您可以使用您的实例模板create an Instance Group,考虑到您可以将托管实例组配置为根据其工作负载自动添加或删除虚拟机。

gcloud compute instance-groups managed create [INSTANCE_GROUP_NAME] \
    --size [SIZE] \
    --template [INSTANCE_TEMPLATE] \
    --zone [ZONE]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-30
    • 2017-12-30
    • 2013-02-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多