Build in admin accounts get disable after sysprep - azure

i have created one windows machine in my hyper-v after sysprep i have upload my VHD to azure account
when i am trying to login that windows machine i am unable to login the account getting disable
can any one please let me know how to login into that machine in azure account
In Adv Thanks.

Of course it is disabled.
sysprep is designed to put the OS into OEM state. All local accounts and user profiles are deleted. Because it will be the base image for all your future VMs.
This process creates a so called generalized image. The process is described here. You can read more about sysprep itself and the process of generalization here.
What you probably need (only probably, because you do not state your real use case), is a specialized image. Specialized image is the only way to just use the VM as is - with all its user profiles. You can read about that process here.
By using the specialized image your OS is left untouched with all its user profiles.

Related

Insufficient quota of vCPUs available after creating a VM, imaging it, and then deleting it

I am testing out Azure VMs as a disaster recovery option for my organization. I'm on an Azure AD trial. My use case is this: Ideally, I'd like to have an image standing by with all the software that my users need, pre-installed, and hooked up to our Azure AD domain. Then, if we should need our DR environment, I'd like to spin up 1..n VMs from the image, send my users the RDP connection files, have them log in with their Office 365 credentials (we also subscribe to Azure AD Premium P1), and get back to work using OneDrive.
I created a VM and populated it with the settings and software I need for my users. It has a local admin, and I confirmed I could log in using my Azure AD credentials. Then I ran sysprep /generalize and created an image of the virtual workstation. So far so good. As I could no longer access the original VM, I deleted it. The original VM was of the DS3_v2 size.
Now I'm going to create a new VM from my image to test. In the Azure portal, I go to Virtual Machines -> Add. I select my image and Resource Group. However, when I go to select a Size, I get the following error message:
"4 vCPUs are needed for this configuration, but only 0 vCPUs (of 4) remain for the Standard DSv2 Family vCPUs." I cannot select any of the available options. The "Troubleshoot" link directs me to a page instructing me to request a quota increase, but that shouldn't be necessary; I de-allocated [edit: deleted] the old VM and its 4 vCPUs so I could create a new one. Why is Azure telling me I only have 0 vCPUs left in my trial subscription?
This morning when I tried again, the console allowed me to select a size. It appears that there is a very substantial delay between when you delete the VM and when Azure marks the vCPUs as available to use once again.

Azure VM complete replication

I have a azure vm setup that contains custom software, files, folders blah blah. At any point I will need to create multiple identical instances of the existing vm (maybe up to 30). I used the sysprep in the vm, in the azure portal I used the capture image for the vm and tried to create a new VM from the image. The new vm created from the image did not contain any of the files from the previous vm.
What would be the best approach in preserving a complete image of the vm and be able to mass deploy from it at any given time?
I'm not sure what you do makes the file disappear, but on my side, it works well. Sysprep just removes all your personal account and security information and then prepares the machine to be used as an image. You can see the feathers of it from Sysprep overview.
To create a custom VM image, see Create a managed image of a generalized VM in Azure. I suggest that creating an image directly from the VM ensures that the image includes all of the disks associated with the VM, including the OS disk and any data disks.
For the creation of multiple identical instances, you can use the Azure VM Scale Sets. The VMs are identical, load balanced in a group, so if you want to specialize one of them, you need to specialize all of them through a custom image.
Also, you can use the Azure Template to create multiple individual VMs, they are 他the independent VMs, you can specialize any one of them, not all of them, but uniform management is a little difficult.
You can get more details about the difference between them, see Differences between virtual machines and scale sets.

How do you create an Azure virtual machine that looses state on disconnect?

I would like to create a virtual machine in Azure that is automatically reset to the just-deployed state after a user disconnects. I can probably do this through creating a backup image and doing a restore after the user logs out with Save-AzureVMImage, but I am wondering if there is any way to set the machine to not save state at all, as used to be the default case in old virtual machines. The reset state must include the state of the OS, not just applications, so it is bit-for-bit identical (or as practically close as possible) to an initial deployment. Right now I am re-deploying a new VM manually to achieve this goal.
Is there a way to configure a VM to behave like I want?
If not, is there a way to automate the restore process after a user logs out of the VM?
There's no such feature, but shouldn't be hard to develop something like this using Automation. The first DevOps logic I could think of is:
Create a VM image
Create a Powershell script to destroy the old and deploy a new VM from this image
Create an Automation account and create a runbook with this script
Use Webhook to trigger the runbook
Create a Powershell script to verify if no users are logged in (may need more logic in here)
Improve this script to make an HTTP POST to trigger the runbook
Assign User Logoff Script
Probably you could skip step 5 tho and step 2 actually needs to be done after step 7 because you need the script configured in the VM before snapshot.

Azure Batch - Create Nodes from VM Image

I have some Selenium test code that I need to run in parallel. In order for Selenium to run effectively, certain configurations have to be done on the machine (I.E. zone settings, Chrome and Firefox installs, etc.) and these settings are hard (if not impossible) to apply via an automated approach. I've manually created a VM, done all the setup and created an image following the directions in Microsoft's documentation.
Now I need to setup my code so that I can specify a VM image to use when creating the nodes. I've searched as much as I can and not found any documentation that explains how I can go about doing this. The example in the DotNetTutorial sample doesn't seem to have any way to specify an image.
There is a feedback item here on this same topic and shows the request as started on Jun 1st 2015. I'm hoping this means that it's done now and that it just hasn't been documented well.
Q: How I can specify a custom VM image as the source for my Azure Batch nodes?
https://github.com/Azure/azure-sdk-for-net/blob/AutoRest/src/Batch/Client/changelog.md
• Added support for deploying nodes using custom VHDs, via the OSDisk property of VirtualMachineConfiguration. Note that the Batch account being used must have been created with PoolAllocationMode = UserSubscription to allow this.
Updated Answer on 2017-12-05:
Custom images are now supported through normal Batch accounts (i.e., Batch service pool allocation mode accounts). You will need to specify a valid ARM Image Id and use Azure Active Directory authentication to create custom images (shared key auth does not support custom images).
Updated Answer on 2017-03-17:
Custom images are now supported through "User Subscription" Batch accounts. You can create these types of accounts in Azure Portal or through the newest management SDKs for supported languages.
Previous Answer:
Currently, custom VM images are not supported. As you noted, this is a feature that is being worked on. In addition to uservoice, you can periodically check for product updates at this site.

Azure VM Capture (Process Overview)

I am planning to capture my VM image in Azure to create a copy for VM deployments (I am using this to deploy multiple VM or any redeployment scenarios).
Will any data/ configurations lost during the process? Be it application wise or server. I am expecting it to work just as simple as copy and paste functionality no Gotchas. Everything within this VM is critical to my clients (Customized apps/ web services etc.)
P/S: I have done my research here: https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-capture-image-windows-server/
It says it will delete my VM once I have captured the image, now this is where I am very worried about.
Process of capturing the VM will preserve the installed applications, data and most settings. However, it does clear a few things like the computer name, network settings etc, so that the same image could be used to create multiple VMs later on.
Also, this process will delete your existing VM. You have to create a new VM using the image.
If you are unsure about any required settings that may be lost in this process, strong recommendation is to create a backup of the existing VM before you begin. You can do that by doing AzCopy of all the vhds on the VM (OS and Data disks). You could delete the backup after verifying the image deployments.
There are two ways of creating Virtual Images:
Without deprovisioning it: Source VM is not destroyed. You should switch if off to avoid problems. If you create a VM from image their hostnames will clash. The idea is using this capture method for backups.
After running waagennt -deprovision on it: Source VM is destroyed in the process. You can create many VMs with no problem.This is probably what you want to do. Don't worry is harmless, apart of destroying source VM. You can always create a VM from that image. The idea is using this capture method for creating a base image and then have some kind of process to create and destroy servers (Auto Scaling).
For example you create a web server for your app and instantiate more VMs in peak times.
What does waagent exactly deprovision?
waagent -deprovision command clears some configuration on the machine. Exactly:
This command will attempt to clean the system and make it suitable for
re-provisioning. This operation performs the following tasks:
Removes SSH host keys (if Provisioning.RegenerateSshHostKeyPair is 'y' in the configuration file)
Clears nameserver configuration in /etc/resolv.conf Removes the root user's password from /etc/shadow (if
Provisioning.DeleteRootPassword is 'y' in the configuration file)
Removes cached DHCP client leases Resets host name to localhost.localdomain
Deletes the last provisioned user account (obtained from /var/lib/waagent) and associated data.
Apart of this nothing will be touch on your server.

Resources