Join us for a virtual Nutanix User Group meeting with Jarian Gibson as he covers Nutanix Cloud Clusters (NC2) on Azure and AWS with Citrix. <\/span><\/p>

Jarian will take a deep dive into NC2 on Azure architecture and Citrix on NC2 on Azure\u00a0that helps you strengthen your business continuity and disaster recovery position. He\u2019ll also provide the latest updates for NC2 on AWS.<\/span><\/p>

Plus, we're\u00a0giving away a Nutanix suitcase to one lucky winner!\u00a0Opt-in when you register\u00a0to be entered to win.\u00a0<\/p>","author":{"id":113632,"url":"\/members\/karlie-beil-113632","name":"Karlie Beil","avatar":"https:\/\/uploads-us-west-2.insided.com\/nutanix-us\/icon\/200x200\/1581aab3-bcf6-49f4-b2fb-3d11e8c010dc.png","userTitle":"Community Manager","rank":{"isBold":false,"isItalic":false,"isUnderline":false,"name":"Community Manager","color":"#0873ba"},"userLevel":4},"type":"Webinar","url":"https:\/\/next.nutanix.com\/events\/global-nug-nc2-on-azure-and-aws-with-citrix-151","image":"https:\/\/uploads-us-west-2.insided.com\/nutanix-us\/attachment\/f9693b5b-436b-427a-9b98-531b4040ff24_thumb.png","location":"","startsAt":1678298400,"endsAt":1678302000,"contentType":"event","attendees":[],"attendeeCount":0,"isLoggedInUserAttendee":false,"createdAt":"1675974969"},"phrases":{"Forum":{"{n} year|{n} years":"{n} year|{n} years","{n} month|{n} months":"{n} month|{n} months","{n} day|{n} days":"{n} day|{n} days","{n} hour|{n} hours":"{n} hour|{n} hours","{n} minute|{n} minutes":"{n} minute|{n} minutes","just":"just now","{plural} ago":"{plural} ago"}}}">

解决了

powershell命令克隆虚拟机


UserLevel 2
徽章 +2

我们可以在此命令上获取更多文档吗?

克隆ntnxvirtualmachine

所需的参数之一是 - 准列表

我想澄清一下此参数以及如何使用它。这是一个值数组吗?我是链接到CSV或JSON文件吗?

一个例子会很好。

使用UI,我当前克隆参考图像来创建VM,我很想让PS脚本进行工作。我可以将其与ACLI命令一起使用,但是PS更具用途,我相信,如果我更好地了解此命令,尤其是该参数更好,我可以让它做更多的事情。

图标

最好的答案hitesh08012019年11月5日,18:36

\u00a0<\/p>

Cloning VM using PowerShell could be done to use Clone-NTNXVirtualMachine commandlet.
For example,<\/p>

PS> spec = New-NTNXObject -Name VMCloneSpecDTO\u00a0
PS> spec.name = \"cloneOne\"\u00a0
PS> vm = get-ntnxvm | Where-Object { $_.vmName -eq \"clone-base\" }\u00a0
PS> Clone-NTNXVirtualMachine -Vmid $vm.vmId -SpecList $spec\u00a0<\/p>

\u00a0 \u00a0+Create VMCloneSpecDTO and set new VM name to spec.name field.
\u00a0 \u00a0+Retrieve existing VM
\u00a0 \u00a0+Run Clone-NTNXVirtualMachine commandlet with vmid of the existing VM and spec object previously created.<\/p>

\u00a0<\/p>

So what exactly is\u00a0New-NTNXObject?<\/em><\/strong><\/p>

\u00a0<\/p>

The New-NTNXObject cmdlet to create a data transfer object (DTO) lists.<\/p>

\u00a0<\/p>

Hope this helps!<\/p>","className":"post__content__best_answer"}">

查看原件

该主题已关闭以供评论

2个答复

UserLevel 4
徽章 +5

可以使用PowerShell克隆VM使用Clone-ntnxvirtualMachine Commandlet。
例如,

ps> spec = new -ntnxObject -name vmclonespecdto
ps> spec.name =“ cloneone”
ps> vm = get-ntnxvm |where-object {$_。vmname-eq“ clone-base”}
ps> clone -n​​tnxvirtualmachine -vmid $ vm.vmid -speclist $ spec

+创建VMClonesPecDTO并将新的VM名称设置为Spec.Name字段。
+检索现有的VM
+运行具有现有VM和SPEC对象的VMID的Clone-ntnxvirtualMachine命令:以前创建的vmid。

那么new-ntnxObject到底是什么?

创建数据传输对象(DTO)列表的New-ntnxObject cmdlet。

希望这可以帮助!

UserLevel 4
徽章 +5

你好 @ValeryV @tshepo

您可以使用Cloud-Init或Sysprep(基于OS)在克隆VM时提供详细信息。

有关云的详细信息
https://next.nutanix.com/blog-40/customizing-vms-with-cloud-init-nutanix-nutanix-ahv-part-part-part-part-1-14573

可以帮助您编写云的命令的帖子
https://next.nutanix.com/scripts-32/cloud-init-config-with-powershell-cmdlets-17931

一篇很棒的文章使用SYSPREP通过配置在AHV上部署Windows VM。

http://vzare.com/nutanix-mass-deployment-of-windows-2016-on-ahv-using-sysprep-answerfile-and-powershell/


Learn more about our cookies.<\/a>","cookiepolicy.button":"Accept cookies","cookiepolicy.button.deny":"Deny all","cookiepolicy.link":"Cookie settings","cookiepolicy.modal.title":"Cookie settings","cookiepolicy.modal.content":"We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.<\/a>","cookiepolicy.modal.level1":"Basic
Functional","cookiepolicy.modal.level2":"Normal
Functional + analytics","cookiepolicy.modal.level3":"Complete
Functional + analytics + social media + embedded videos"}}}">
Baidu