您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

教程:设置教室实验室Tutorial: Set up a classroom lab

在本教程中,请设置带虚拟机的课堂实验室,供学生在课堂上使用。In this tutorial, you set up a classroom lab with virtual machines that are used by students in the classroom.

在本教程中,将执行以下操作:In this tutorial, you do the following actions:

  • 创建课堂实验室Create a classroom lab
  • 将用户添加到实验室Add users to the lab
  • 为实验室设置计划Set schedule for the lab
  • 向学生发送邀请电子邮件Send invitation email to students

先决条件Prerequisites

在本教程中,我们使用课堂用虚拟机设置一个实验室。In this tutorial, you set up a lab with virtual machines for your class. 只有充当下述角色之一的成员才能在实验室帐户中设置课堂实验室:所有者、实验室创建者或参与者。To set up a classroom lab in a lab account, you must be a member of one of these roles in the lab account: Owner, Lab Creator, or Contributor. 用来创建实验室帐户的帐户会自动添加到所有者角色。The account you used to create a lab account is automatically added to the owner role. 因此,我们可以使用创建实验室帐户所用的用户帐户创建一个课堂实验室。So, you can use the user account that you used to create a lab account to create a classroom lab.

下面是使用 Azure 实验室服务时的典型工作流:Here is the typical workflow when using Azure Lab Services:

  1. 实验室帐户创建者将其他用户添加到“实验室创建者”角色。A lab account creator adds other users to the Lab Creator role. 例如,实验室帐户创建者/管理员将教师添加到“实验室创建者”角色,这样教师就可以创建课堂实验室。For example, the lab account creator/admin adds educators to the Lab Creator role so that they can create labs for their classes.
  2. 然后,教师创建包含 VM 的课堂实验室,并向课堂上的学生发送注册链接。Then, the educators create labs with VMs for their classes and send registration links to students in the class.
  3. 学生使用从教师处收到的注册链接来注册实验室。Students use the registration link that they receive from educators to register to the lab. 注册以后,他们可以使用实验室中的 VM 完成课堂作业和家庭作业。Once they are registered, they can use VMs in the labs to do the class work and home work.

创建课堂实验室Create a classroom lab

此步骤在 Azure 中创建一个课堂实验室。In this step, you create a lab for your class in Azure.

  1. 导航到 Azure 实验室服务网站Navigate to Azure Lab Services website. 请注意,尚不支持 Internet Explorer 11。Note that Internet Explorer 11 is not supported yet.

  2. 选择“登录”并输入凭据。Select Sign in and enter your credentials. Azure 实验室服务支持组织帐户和 Microsoft 帐户。Azure Lab Services supports organizational accounts and Microsoft accounts.

  3. 选择“新建实验室”。Select New lab.

    此屏幕截图显示了选中“新建实验室”按钮的“Azure 实验室服务”。

  4. 在“新建实验室”窗口中,执行以下操作::In the New Lab window, do the following actions:

    1. 指定实验室的 名称,然后选择“下一步”。Specify a name for your lab, and select Next.

      创建课堂实验室

    2. 在“虚拟机凭据”页上,指定实验室中所有 VM 的默认凭据。On the Virtual machine credentials page, specify default credentials for all VMs in the lab. 指定用户的 名称密码,然后选择“下一步”。Specify the name and the password for the user, and then select Next.

      “新建实验室”窗口

      重要

      记下用户名和密码。Make a note of user name and password. 这些信息不会再次显示。They won't be shown again.

    3. 在“实验室策略”页上,选择“完成”。 On the Lab policies page, select Finish.

      每个用户的配额

  5. 此时会看到以下屏幕,显示模板 VM 的创建状态。You should see the following screen that shows the status of the template VM creation. 此操作最多需要 20 分钟。This operation takes up to 20 minutes.

    模板 VM 的创建状态

  6. 在“模板”页上执行以下步骤:对于此教程来说,这些步骤是 可选 的。On the Template page, do the following steps: These steps are optional for the tutorial.

    1. 选择“连接”以连接到模板 VM。Connect to the template VM by selecting Connect. 如果它是 Linux 模板 VM,请选择是要使用 SSH 还是 RDP(如果已启用 RDP)来建立连接。If it's a Linux template VM, you choose whether you want to connect using SSH or RDP (if RDP is enabled).
    2. 在模板 VM 上安装并配置课堂所需软件。Install and configure software required for your class on the template VM.
    3. 停止 模板 VM。Stop the template VM.

    备注

    模板 VM 在运行时会产生成本,因此,请确保在不需要运行模板 VM 时将它关闭。Template VMs incur cost when running, so ensure that the template VM is shutdown when you don’t need it to be running.

发布模板 VMPublish the template VM

在此步骤中,我们发布模板 VM。In this step, you publish the template VM. 你发布模板 VM 时,Azure 实验室服务会使用该模板在实验室中创建 VM。When you publish the template VM, Azure Lab Services creates VMs in the lab by using the template. 所有虚拟机的配置都与模板相同。All virtual machines have the same configuration as the template.

  1. 在“模板”页上的工具栏中选择“发布”。On the Template page, select Publish on the toolbar.

    “发布模板”按钮

    警告

    发布后无法取消发布。Once you publish, you can't unpublish.

  2. 在“发布模板”页上,输入要在实验室中创建的虚拟机的数目,然后选择“发布”。On the Publish template page, enter the number of virtual machines you want to create in the lab, and then select Publish.

    发布模板 - VM 数

  3. 可以在页面上查看模板的 发布状态You see the status of publishing the template on page. 此过程最长可能需要花费一小时。This process can take up to an hour.

    发布模板 - 进度

  4. 等待发布完成,然后选择左侧菜单上的“虚拟机”或选择“虚拟机”磁贴,切换到“虚拟机池”页。 Wait until the publishing is complete and then switch to the Virtual machines pool page by selecting Virtual machines on the left menu or by selecting Virtual machines tile. 确认看到这些虚拟机处于“未分配”状态。Confirm that you see virtual machines that are in Unassigned state. 这些 VM 尚未分配给学生。These VMs are not assigned to students yet. 它们应该处于“已停止”状态。They should be in Stopped state. 可以在此页上启动学生 VM,连接到该 VM,停止该 VM,然后删除该 VM。You can start a student VM, connect to the VM, stop the VM, and delete the VM on this page. 你可以在此页中启动这些 VM,也可以让你的学生启动它们。You can start them in this page or let your students start the VMs.

    处于已停止状态的虚拟机

    备注

    当教师打开学生 VM 时,该学生的配额不会受到影响。When an educator turns on a student VM, quota for the student isn't affected. 用户配额指定用户在计划上课时间之外可用的实验室小时数。Quota for a user specifies the number of lab hours available to the user outside of the scheduled class time. 有关配额的详细信息,请参阅为用户设置配额For more information on quotas, see Set quotas for users.

为实验室设置计划Set a schedule for the lab

为实验室创建计划事件,这样实验室中的 VM 就会在特定时间自动启动/停止。Create a scheduled event for the lab so that VMs in the lab are automatically started/stopped at specific times. 此前指定的用户配额(默认值:10 小时)是在此计划时间之外为每个用户分配的额外时间。The user quota (default: 10 hours) you specified earlier is the additional time assigned to each user outside this scheduled time.

  1. 切换到“日程安排”页,再选择工具栏上的“添加计划事件”。Switch to the Schedules page, and select Add scheduled event on the toolbar.

    此屏幕截图显示了“日程安排”页上的“添加计划事件”按钮。

  2. 在“添加计划事件”页上执行以下步骤:On the Add scheduled event page, do the following steps:

    1. 确认已选择“标准”作为“事件类型”。 Confirm that Standard is selected the Event type.
    2. 选择课堂的“开始日期”。Select the start date for the class.
    3. 选择“启动时间”,这是你希望 VM 启动的时间。Select the start time at which you want the VMs to be started.
    4. 选择“停止时间”,这是 VM 将要关闭的时间。Select the stop time at which the VMs are to be shut down.
    5. 选择“时区”,该时区适用于已指定的启动时间和停止时间。Select the time zone for the start and stop times you specified.
  3. 在同一“添加计划事件”页上的“重复”部分,选择当前计划。 On the same Add scheduled event page, select the current schedule in the Repeat section.

    “日程安排”页上的“添加日程安排”按钮

  4. 在“重复”对话框中,执行以下步骤:On the Repeat dialog box, do the following steps:

    1. 对于“重复”字段,请确认已设置“每周” 。Confirm that every week is set for the Repeat field.

    2. 选择希望计划生效的日期。Select the days on which you want the schedule to take effect. 在下面的示例中,选中的是“星期一”至“星期五”。In the following example, Monday-Friday is selected.

    3. 选择计划的 结束日期Select an end date for the schedule.

    4. 选择“保存”。Select Save.

      设置重复计划

  5. 现在,请在“添加计划事件”页上输入该计划的任何说明或备注作为“备注(可选)”。Now, on the Add scheduled event page, for Notes (optional), enter any description or notes for the schedule.

  6. 在“添加计划事件”页上,选择“保存”。On the Add scheduled event page, select Save.

    每周日程安排

  7. 在日历中导航到开始日期,确认是否已设置该计划。Navigate to the start date in the calendar to verify that the schedule is set.

    日历中的计划

    有关创建和管理课堂计划的详细信息,请参阅创建和管理实验室的计划For more information about creating and managing schedules for a class, see Create and manage schedule for labs.

将用户添加到实验室Add users to the lab

添加用户时,默认情况下,“限制访问”选项处于打开状态,除非他们在用户列表中,否则即使学生有注册链接,他们也无法注册到实验室。When you add users, by default, the Restrict access option is turned on and, unless they're in the list of users, students can't register with the lab even if they have a registration link. 只有列出的用户可以使用你发送的注册链接注册到实验室。Only listed users can register with the lab by using the registration link you send. 你可以关闭“限制访问”,这样一来,学生只要有注册链接就可以注册到实验室。You can turn off Restrict access, which allows students to register with the lab as long as they have the registration link.

从 Azure AD 组添加用户Add users from an Azure AD group

可以将实验室用户列表同步到现有 Azure Active Directory (Azure AD) 组,这样就无需手动添加或删除用户。You can sync a lab user list to an existing Azure Active Directory (Azure AD) group so that you do not have to manually add or delete users.

可以在组织的 Azure Active Directory 中创建 Azure AD 组,以管理对组织资源和基于云的应用的访问。An Azure AD group can be created within your organization's Azure Active Directory to manage access to organizational resources and cloud-based apps. 若要了解详细信息,请参阅 Azure AD 组To learn more, see Azure AD groups. 如果组织使用 Microsoft Office 365 或 Azure 服务,则组织已有管理 Azure Active Directory 的管理员。If your organization uses Microsoft Office 365 or Azure services, your organization will already have admins who manage your Azure Active Directory.

重要

确保用户列表为空。Make sure the user list is empty. 如果实验室中存在手动添加或通过导入 CSV 文件添加的现有用户,则不会显示用于将实验室同步到现有组的选项。If there are existing users inside a lab that you added manually or through importing a CSV file, the option to sync the lab to an existing group will not appear.

  1. 在左窗格中,选择“用户”。In the left pane, select Users.

  2. 单击“从组同步”。Click Sync from group.

    通过从 Azure AD 组同步来添加用户

  3. 系统将提示你选择要将实验室同步到的现有 Azure AD 组。You will be prompted to pick an existing Azure AD group to sync your lab to.

    如果在列表中看不到 Azure AD 组,可能是由于以下原因造成的:If you don't see an Azure AD group in the list, could be because of the following reasons:

    • 如果你是 Azure Active Directory 的来宾用户(通常是在拥有 Azure AD 的组织之外),你将无法在 Azure AD 内搜索组。If you are a guest user for an Azure Active Directory (usually if you're outside the organization that owns the Azure AD), and you are not able to to search for groups inside the Azure AD. 在这种情况下,你将无法向实验室添加 Azure AD 组。In this case, you won’t be able to add an Azure AD group to the lab in this case.
    • 通过 Teams 创建 Azure AD 组不会显示在此列表中。Azure AD groups created through Teams do not show up in this list. 你可以在 Teams 内添加 Azure 实验室服务应用,以便直接从中创建和管理实验室。You can add the Azure Lab Services app inside Teams to create and manage labs directly from within it. 请参阅有关从 Teams 内部管理实验室用户列表的详细信息。See more information about managing a lab’s user list from within Teams.
  4. 选择要将实验室同步到 Azure AD 组后,单击“添加”。Once you picked the Azure AD group to sync your lab to, click Add.

  5. 同步实验室后,它会将 Azure AD 组内的所有人作为用户拉入实验室,你将看到更新的用户列表。Once a lab is synced, it will pull everyone inside the Azure AD group into the lab as users, and you will see the user list updated. 只有此 Azure AD 组中的人员才能访问你的实验室。Only the people in this Azure AD group will have access to your lab. 用户列表将每 24 小时刷新一次,以与 Azure AD 组的最新成员身份匹配。The user list will refresh every 24 hours to match the latest membership of the Azure AD group. 还可以单击“用户”选项卡中的“同步”按钮,手动同步到 Azure AD 组中的最新更改。You can also click on the Sync button in the Users tab to manually sync to the latest changes in the Azure AD group.

  6. 单击“全部邀请”按钮邀请用户加入实验室,这将向所有用户发送一封电子邮件,其中包含实验室的注册链接。Invite the users to your lab by clicking on the Invite All button, which will send an email to all users with the registration link to the lab.

从电子邮件或 CSV 文件中手动添加用户Add users manually from email(s) or CSV file

在本部分中,你将手动添加学生(通过电子邮件地址或上传 CSV 文件)。In this section, you add students manually (by email address or by uploading a CSV file).

按电子邮件地址添加用户Add users by email address

  1. 在左窗格中,选择“用户”。In the left pane, select Users.

  2. 单击“手动添加用户”。Click Add users manually.

    手动添加用户

  3. 选择“按电子邮件地址添加”(默认),在单独的行或用分号分隔的单个行上输入学生的电子邮件地址。Select Add by email address (default), enter the students' email addresses on separate lines or on a single line separated by semicolons.

    添加用户的电子邮件地址

  4. 选择“保存”。Select Save.

    该列表显示当前用户的电子邮件地址和状态,无论他们是否已注册到实验室。The list displays the email addresses and statuses of the current users, whether they're registered with the lab or not.

    用户列表

    备注

    学生注册到实验室后,列表将显示其名称。After the students are registered with the lab, the list displays their names. 列表中显示的名称是按 Azure Active Directory 中学生的名字和姓氏构造的。The name that's shown in the list is constructed by using the first and last names of the students in Azure Active Directory.

通过上传 CSV 文件添加用户Add users by uploading a CSV file

还可以通过上载包含其电子邮件地址的 CSV 文件来添加用户。You can also add users by uploading a CSV file that contains their email addresses.

CSV 文本文件用于存储以逗号分隔 (CSV) 的表格数据(数字和文本)。A CSV text file is used to store comma-separated (CSV) tabular data (numbers and text). CSV 文件存储以逗号分隔的信息,而不是将信息存储在列字段中(如电子表格中)。Instead of storing information in columns fields (such as in spreadsheets), a CSV file stores information separated by commas. CSV 文件中的每一行都相同数量的以逗号分隔的“字段”。Each line in a CSV file will have the same number of comma-separated "fields." 可以使用 Excel 轻松创建和编辑 CSV 文件。You can use Excel to easily create and edit CSV files.

  1. 在 Microsoft Excel 中,创建一个在一列中列出学生电子邮件地址的 CSV 文件。In Microsoft Excel, create a CSV file that lists students' email addresses in one column.

    CSV 文件中的用户列表

  2. 在“用户”窗格的顶部,选择“添加用户”,然后选择“上传 CSV” 。At the top of the Users pane, select Add users, and then select Upload CSV.

  3. 选择包含学生电子邮件地址的 CSV 文件,然后选择“打开”。Select the CSV file that contains the students' email addresses, and then select Open.

    “添加用户”窗口显示 CSV 文件中的电子邮件地址列表。The Add users window displays the email address list from the CSV file.

  4. 选择“保存”。Select Save.

  5. 在“用户”窗格中,查看添加的学生列表。In the Users pane, view the list of added students.

    用户”窗格中已添加用户的列表

向用户发送邀请电子邮件Send invitation emails to users

  1. 切换到“用户”视图(如果尚未转到该页),然后在工具栏上选择“全部邀请”。 Switch to the Users view if you are not on the page already, and select Invite all on the toolbar.

    选择学生

  2. 在“通过电子邮件发送邀请”页上,输入可选的消息,然后选择“发送”。 On the Send invitation by email page, enter an optional message, and then select Send. 电子邮件自动包含注册链接。The email automatically includes the registration link. 若要获取此注册链接,可以选择工具栏上的“... (省略号)”,然后选择“注册链接”。 You can get this registration link by selecting ... (ellipsis) on the toolbar, and Registration link.

    通过电子邮件发送注册链接

  3. 可以在“用户”列表中查看 邀请 状态。You see the status of invitation in the Users list. 状态应更改为“正在发送”,然后更改为“已在 <日期> 发送”。 The status should change to Sending and then to Sent on <date>.

若要详细了解如何将学生添加到课堂并管理其对实验室的使用,请参阅如何配置学生对实验室的使用For more information about adding students to a class and managing their usage of the lab, see How to configure student usage.

后续步骤Next steps

在本教程中,你在 Azure 中创建了一个课堂实验室。In this tutorial, you created a lab for your class in Azure. 若要了解学生如何使用注册链接访问实验室中的 VM,请转到下一教程:To learn how a student can access a VM in the lab using the registration link, advance to the next tutorial: