Azure Windows2012升级2016

2024-05-10 08:44
文章标签 升级 azure 2016 windows2012

本文主要是介绍Azure Windows2012升级2016,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Azure Windows2012升级2016

  • 在自己电脑配置Azure PowerShell
    • 前置条件
    • PowerShell 登录到 Azure
  • Azure 中运行 Windows Server 的 VM 的就地升级
    • 前置条件,生成一块OS磁盘
    • 将生成的OS磁盘附件到需升级的服务器
    • 执行就地升级到 Windows Server 2016
  • 升级后配置
  • 故障恢复

在 Windows 上安装 Azure PowerShell官方文档:
https://learn.microsoft.com/zh-cn/powershell/azure/install-azps-windows?view=azps-11.6.0&viewFallbackFrom=azps-11.1.0&tabs=windowspowershell&pivots=windows-psgallery

Azure 中运行 Windows Server 的 VM 的就地升级官方文档:
https://docs.azure.cn/zh-cn/virtual-machines/windows-in-place-upgrade

在自己电脑配置Azure PowerShell

前置条件

从 PowerShell 运行以下命令以确定 PowerShell 版本

$PSVersionTable.PSVersion

确定是否安装了 AzureRM PowerShell 模块

Get-Module -Name AzureRM -ListAvailable

以提升为管理员的权限启动 Windows PowerShell 5.1,并运行以下命令以更新 PowerShellGet:

Install-Module -Name PowerShellGet -Force

将 PowerShell 执行策略设置为“远程签名”或“更低限制”

Get-ExecutionPolicy -List

将 PowerShell 执行策略设置为远程签名:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

安装 Az PowerShell 模块

Install-Module -Name Az -Repository PSGallery -Force

更新 Az PowerShell 模块

Update-Module -Name Az -Force

PowerShell 登录到 Azure

登录到中国区Azure

Connect-AzAccount -EnvironmentName AzureChinaCloud

国际区

Connect-AzAccount

PowerShell 登录到 Azure后切换订阅

Set-AzContext -Subscription 订阅名

Azure 中运行 Windows Server 的 VM 的就地升级

前置条件,生成一块OS磁盘

  • 对服务器创建快照,看公共IP地址是否为静态,不是的话与客户沟通变更为静态公共IP,否则可能会导致更新后公共IP发生变化,如没有公共IP则忽略
  • 已本机管理员权限打开power shell 登录Azure后 执行命令,更新资源组名称 地域后 复制粘贴执行即可
  • 目的是在Azure上生成一块系统镜像磁盘
Connect-AzAccount -EnvironmentName AzureChinaCloud
#
# Customer specific parameters# Resource group of the source VM
$resourceGroup = "资源组名称"# Location of the source VM
$location = "ChinaNorth2"# Zone of the source VM, if any
$zone = "" # Disk name for the that will be created
$diskName = "WindowsServer2016UpgradeDisk"# Target version for the upgrade - must be either server2022Upgrade, server2019Upgrade, server2016Upgrade or server2012Upgrade
$sku = "server2016Upgrade"# Common parameters$publisher = "MicrosoftWindowsServer"
$offer = "WindowsServerUpgrade"
$managedDiskSKU = "Standard_LRS"#
# Get the latest version of the special (hidden) VM Image from the Azure Marketplace$versions = Get-AzVMImage -PublisherName $publisher -Location $location -Offer $offer -Skus $sku | sort-object -Descending {[version] $_.Version	}
$latestString = $versions[0].Version# Get the special (hidden) VM Image from the Azure Marketplace by version - the image is used to create a disk to upgrade to the new version$image = Get-AzVMImage -Location $location `-PublisherName $publisher `-Offer $offer `-Skus $sku `-Version $latestString#
# Create Resource Group if it doesn't exist
#if (-not (Get-AzResourceGroup -Name $resourceGroup -ErrorAction SilentlyContinue)) {New-AzResourceGroup -Name $resourceGroup -Location $location    
}#
# Create Managed Disk from LUN 0
#if ($zone){$diskConfig = New-AzDiskConfig -SkuName $managedDiskSKU `-CreateOption FromImage `-Zone $zone `-Location $location
} else {$diskConfig = New-AzDiskConfig -SkuName $managedDiskSKU `-CreateOption FromImage `-Location $location
} Set-AzDiskImageReference -Disk $diskConfig -Id $image.Id -Lun 0New-AzDisk -ResourceGroupName $resourceGroup `-DiskName $diskName `-Disk $diskConfig

将生成的OS磁盘附件到需升级的服务器

在这里插入图片描述

执行就地升级到 Windows Server 2016

  • 远程连接到服务器
  • 确定升级os磁盘的驱动器号
  • 启动 Windows PowerShell
  • 在PowerShell 切换目录到升级os磁盘
cd  目录名
#例如 cd  D:\BaiduNetdiskDownload\navicat
.\setup.exe /auto upgrade /dynamicupdate disable

在这里插入图片描述

大概需要执行4小时左右

  • 通常windows映像的OS磁盘是128G
  • datacenter-core是没有图形化
  • smalldisk指的是OS磁盘使用的是30G

可以在控制台选择“启动诊断”选项以查看日志和屏幕截图。
在这里插入图片描述

升级后配置

  • 如果创建了 OS 磁盘和数据磁盘的快照,请将其删除。
  • 删除新建的升级OS磁盘
  • 启用在升级过程开始时可能已禁用的任何防病毒、反间谍软件或防火墙软件
  • 更新漏洞补丁,关闭自动更新

故障恢复

如果就地升级过程未能成功完成,在创建了操作系统磁盘和数据磁盘快照的情况下,可以返回到 VM 的先前版本。

这篇关于Azure Windows2012升级2016的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/975976

相关文章

将Mybatis升级为Mybatis-Plus的详细过程

《将Mybatis升级为Mybatis-Plus的详细过程》本文详细介绍了在若依管理系统(v3.8.8)中将MyBatis升级为MyBatis-Plus的过程,旨在提升开发效率,通过本文,开发者可实现... 目录说明流程增加依赖修改配置文件注释掉MyBATisConfig里面的Bean代码生成使用IDEA生

linux环境openssl、openssh升级流程

《linux环境openssl、openssh升级流程》该文章详细介绍了在Ubuntu22.04系统上升级OpenSSL和OpenSSH的方法,首先,升级OpenSSL的步骤包括下载最新版本、安装编译... 目录一.升级openssl1.官网下载最新版openssl2.安装编译环境3.下载后解压安装4.备份

怎么关闭Ubuntu无人值守升级? Ubuntu禁止自动更新的技巧

《怎么关闭Ubuntu无人值守升级?Ubuntu禁止自动更新的技巧》UbuntuLinux系统禁止自动更新的时候,提示“无人值守升级在关机期间,请不要关闭计算机进程”,该怎么解决这个问题?详细请看... 本教程教你如何处理无人值守的升级,即 Ubuntu linux 的自动系统更新。来源:https://

你的华为手机升级了吗? 鸿蒙NEXT多连推5.0.123版本变化颇多

《你的华为手机升级了吗?鸿蒙NEXT多连推5.0.123版本变化颇多》现在的手机系统更新可不仅仅是修修补补那么简单了,华为手机的鸿蒙系统最近可是动作频频,给用户们带来了不少惊喜... 为了让用户的使用体验变得很好,华为手机不仅发布了一系列给力的新机,还在操作系统方面进行了疯狂的发力。尤其是近期,不仅鸿蒙O

macOS升级后SVN升级

问题 svn: error: The subversion command line tools are no longer provided by Xcode. 解决 sudo chown -R $(whoami) /usr/local/Cellar brew install svn

Golang支持平滑升级的HTTP服务

前段时间用Golang在做一个HTTP的接口,因编译型语言的特性,修改了代码需要重新编译可执行文件,关闭正在运行的老程序,并启动新程序。对于访问量较大的面向用户的产品,关闭、重启的过程中势必会出现无法访问的情况,从而影响用户体验。 使用Golang的系统包开发HTTP服务,是无法支持平滑升级(优雅重启)的,本文将探讨如何解决该问题。 一、平滑升级(优雅重启)的一般思路 一般情况下,要实现平滑

JeecgBoot 升级springboot版本到2.6.0

1. 环境描述 Jeecgboot 3.0,他所依赖的springboot版本为2.3.5Release,将springboot版本升级为2.6.0。过程全纪录,从2开始描述。 2. 修改springboot版本号 <parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-pare

欧拉系统 kernel 升级、降级

系统版本  cat  /etc/os-release  NAME="openEuler"VERSION="22.03 (LTS-SP1)"ID="openEuler"VERSION_ID="22.03"PRETTY_NAME="openEuler 22.03 (LTS-SP1)"ANSI_COLOR="0;31" 系统初始 kernel 版本 5.10.0-136.12.0.

Zookeeper集群是如何升级到新版本的

方案1:复用老数据方案 这是经过实践的升级方案,该方案是复用旧版本的数据,zk集群拓扑,配置文件都不变,只是启动的程序为最新的版本。 参考文章: Zookeeper集群是如何升级到新版本的 方案2:重新建立数据方案 该方案的思路是:先停掉一台follower的机器上的服务,然后加入一个新版本的zk(zk的数据目录是空的),然后启动新zk,之后新zk会把旧集群中的数据同步过来。之后再操作另

mysql数据库8.0小版本原地升级

mysql数据库8.0小版本原地升级 准备工作升级工作停库使用新版本软件启动数据库更新环境变量重启数据库 升级日志 OS release: CentOS 7.9升级前DB version: MySQL 8.0.30数据库升级安装包:mysql-8.0.36-linux-glibc2.12-x86_64.tar.xzMySQL Shell安装包:mysql-shell-8.0.36