5 Essential Tips for Maximizing Your Experience at Nutanix .NEXT for Bloggers
So I figured out a way to do this.I used the following command:acli vm.disk_update $name disk_addr="sata.0" clone_from_image="AutoUnattend.iso"I created an ISO with my Answer file in the root and uploaded the image to Prism. Make sure it is called “unattend”. I could have sworn Windows required it to be named AutoUnattend.xml but that didn’t work until I changed the name.So this will work like the GUI where you can upload an Answer file when creating a VM but without using a GUI because yuck.I could also put the answer file in my image and have it run that way but 1. If I update my answer file I have to update my image. 2. I can use different answer files with the image.My next step may be to get this loop for more than 1 VM and/or create them from a CSV (not sure if that will be possible).
I wrote a small script using acli commands to create a vm. Well it is really just a series of commands in one file.Then I use a batch file to run putty/plink that will run the commands. I even managed to get user input and loops in it. I just run the batch file which prompts me for a password, VM name and how many NIC’s.I don’t use it for mass VM creation as I usually just build a server, maybe 2 at a time. But it does help to make sure that all of our VM’s have certain features. For example, I want all of our VM’s to have 2 HD.Then I use a powershell script to do some post configuration tasks. I just put the PS script into the image and when you log in for the first time you run the PS script. For example we disable ipv6, I install the SCCM agent, etc. I make sure the second HD is the D:This really makes it so when other people create VM’s they don’t leave out steps.
Migrating our Hyper-V guest Vm’s to Nutanix.
I figured it out. I had a typo in the other lines. Putting ACLI in front of each command allows it to run. Using ; or && will also allow it to run one command after another. Thanks for the help.
So I figured out to pass a command by putting acli in front of the command. That solves the freezing issue I was having. So this works. acli vm.clone aTest clone_from_vm="Server2016RefImage" memory=8G num_cores_per_vcpu=2 num_vcpus=2; I can get them to run now using putty or plink, there seems to be no difference but what I can't do now is run multiple commands one after another. It will now clone my existing VM but I can't get it to add the hard drive or NIC from a script. Do I need to add in a time delay between commands? Maybe this is something that would work better with a product like Ansible? Ideally I would like to just have the script prompt me for a VM name and IP when I run it. If there is a better way to do this please let me know. Again, I am used to running PS scripts from my laptop to a server and they execute the script. I am just trying to do the equivalent shell commands and I am just not that well versed in shell scripting. I see Nutanix has PS commandlets but
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.