- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想使用 Vagrant 在 Azure 中创建虚拟机。我点击此链接link我已经成功获得了azure的凭据,这是我的vagrantFile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
#Ponemos el plugin que hemos instalado antes y que se explica durante el tutorial
require "vagrant-azure"
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
#Aqui ponemos el nuestro box al lugar del box por defecto.
# config.vm.box = "base"
config.vm.box = "azure"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
config.ssh.private_key_path = "/home/elda/.ssh/id_rsa"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
#config.vm.network "forwarded_port", guest: 80, host: 8080
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
#config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
# View the documentation for the provider you are using for more
# information on available options.
# Configuramos el niuestro proveedor azure
config.vm.provider "azure" do |az, override|
# Los param del VM
#az.vm_name = 'pgtic_test2'
#az.vm_size = 'Standard_B1s'
#az.vm_image_urn = 'Canonical:UbuntuServer:16.04-LTS:latest'
#az.resource_group_name = 'vagrant'
# Aqui usamos el informacion obtenido del servicio principal Azure AD
# Tweak to bypass Azure Box not found
az.tenant_id = ".........."
az.client_id = "........."
az.client_secret = ".........."
az.subscription_id = "............."
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL
end
config.vm.provision "shell", inline: "echo Hello, World"
end
vagrant up
机器时,它给我一个错误,我找不到响应:
Bringing machine 'default' up with 'azure' provider...
==> default: Launching an instance with the following settings...
==> default: -- Management Endpoint: https://management.azure.com
==> default: -- Subscription Id: ebf53860-e727-4003-90bc-3d099632c913
==> default: -- Resource Group Name: red-darkness-38
==> default: -- Location: westus
==> default: -- Admin Username: vagrant
==> default: -- VM Name: polished-voice-23
==> default: -- VM Storage Account Type: Premium_LRS
==> default: -- VM Size: Small
==> default: -- Image URN: canonical:ubuntuserver:16.04.0-LTS:latest
==> default: -- DNS Label Prefix: polished-voice-23
/home/elda/.vagrant.d/gems/2.4.3/gems/azure_mgmt_compute-0.10.0/lib/generated/azure_mgmt_compute/virtual_machine_images.rb:218:in `block in list_async': { (MsRestAzure::AzureOperationError)
"message": "MsRestAzure::AzureOperationError: AuthorizationFailed: The client '6939d76b-a697-42d0-a52f-1af3c8412d51' with object id '6939d76b-a697-42d0-a52f-1af3c8412d51' does not have authorization to perform action 'Microsoft.Compute/locations/publishers/artifacttypes/offers/skus/versions/read' over scope '/subscriptions/ebf53860-e727-4003-90bc-3d099632c913'.",
"request": {
"base_uri": "https://management.azure.com",
"path_template": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions",
"method": "get",
"path_params": {
"location": "westus",
"publisherName": "canonical",
"offer": "ubuntuserver",
"skus": "16.04.0-LTS",
"subscriptionId": "ebf53860-e727-4003-90bc-3d099632c913"
},
"skip_encoding_path_params": null,
"query_params": {
"$filter": null,
"$top": null,
"$orderby": null,
"api-version": "2016-04-30-preview"
},
"skip_encoding_query_params": null,
"headers": {
"Content-Type": "application/json;charset=utf-8",
"accept-language": "en-US",
"x-ms-client-request-id": "da80d2da-c90b-4f3e-8085-8545dfe9928c"
},
"body": null,
"middlewares": [
[
"MsRest::RetryPolicyMiddleware",
{
"times": 3,
"retry": 0.02
}
],
[
"cookie_jar"
]
],
"log": null
},
"response": {
"body": "{\"error\":{\"code\":\"AuthorizationFailed\",\"message\":\"The client '6939d76b-a697-42d0-a52f-1af3c8412d51' with object id '6939d76b-a697-42d0-a52f-1af3c8412d51' does not have authorization to perform action 'Microsoft.Compute/locations/publishers/artifacttypes/offers/skus/versions/read' over scope '/subscriptions/ebf53860-e727-4003-90bc-3d099632c913'.\"}}",
"headers": {
"cache-control": "no-cache",
"pragma": "no-cache",
"content-type": "application/json; charset=utf-8",
"expires": "-1",
"x-ms-failure-cause": "gateway",
"x-ms-request-id": "d2824106-2381-455d-89a8-7b20e84539a3",
"x-ms-correlation-request-id": "d2824106-2381-455d-89a8-7b20e84539a3",
"x-ms-routing-request-id": "FRANCESOUTH:20180419T225147Z:d2824106-2381-455d-89a8-7b20e84539a3",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"x-content-type-options": "nosniff",
"date": "Thu, 19 Apr 2018 22:51:47 GMT",
"connection": "close",
"content-length": "349"
},
"status": 403
}
}
from /home/elda/.vagrant.d/gems/2.4.3/gems/concurrent-ruby-1.0.5/lib/concurrent/promise.rb:501:in `block in on_fulfill'
from /home/elda/.vagrant.d/gems/2.4.3/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/safe_task_executor.rb:24:in `block in execute'
from /home/elda/.vagrant.d/gems/2.4.3/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `block in synchronize'
from /home/elda/.vagrant.d/gems/2.4.3/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `synchronize'
from /home/elda/.vagrant.d/gems/2.4.3/gems/concurrent-ruby-1.0.5/lib/concurrent/synchronization/mri_lockable_object.rb:38:in `synchronize'
from /home/elda/.vagrant.d/gems/2.4.3/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/safe_task_executor.rb:19:in `execute'
from /home/elda/.vagrant.d/gems/2.4.3/gems/concurrent-ruby-1.0.5/lib/concurrent/promise.rb:531:in `block in realize'
from /home/elda/.vagrant.d/gems/2.4.3/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:348:in `run_task'
from /home/elda/.vagrant.d/gems/2.4.3/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:337:in `block (3 levels) in create_worker'
from /home/elda/.vagrant.d/gems/2.4.3/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `loop'
from /home/elda/.vagrant.d/gems/2.4.3/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:320:in `block (2 levels) in create_worker'
from /home/elda/.vagrant.d/gems/2.4.3/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `catch'
from /home/elda/.vagrant.d/gems/2.4.3/gems/concurrent-ruby-1.0.5/lib/concurrent/executor/ruby_thread_pool_executor.rb:319:in `block in create_worker'
非常感谢。
最佳答案
在订阅中创建对象时,我遇到了同样的问题。您的帐户需要适当的权限才能创建对象。
来自 Microsoft:(已编辑)
由于显示的错误,这似乎是最可能的原因。
您使用的服务主体在该租户中没有权限。
租户拥有订阅,服务主体属于租户。 Azure 资源管理器还公开给定主体的基于角色的授权,这将赋予其对 Azure 资源的权限。服务主体似乎无权读取该订阅。
关于azure - 使用vagrant创建虚拟机出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49931523/
由于我在一个团队中工作,我想让与 vagrant(和 Chef-solo)一起工作的过程尽可能顺利。 当团队中的某人更改厨师食谱、角色或其他任何内容时,我希望所有其他团队成员通过在下一个“Vagran
在学习了几天之后,我很高兴能够成功设置我的 VM 并运行 Laravel 起始页。在那里很开心:) 有人可以澄清“何时”使用 Vagrant 函数。我的问题: 如果我打算关闭我的电脑,你应该使用 ha
如果我更改了配置脚本或更糟的基本操作系统,有没有办法强制 vagrant 重新配置或重新下载基本框?我试图改变 config.vm.box和 config.vm.box_url ,但是 vagrant
默认情况下,vagrant将框提取到用户主驱动器-%HOMEDRIVE%\.vagrant.d\boxes。这是在网络位置上。虽然有利于可靠存储,但速度非常慢。 如何更改盒子的位置? 最佳答案 当然。
我的系统上有许多测试 Vagrant 盒,我正在整理它们。我安装了插件,例如vagrant plugin install vagrant-hostsupdater和vagrant plugin ins
我的系统上有许多测试 Vagrant 盒,我正在整理它们。我安装了插件,例如vagrant plugin install vagrant-hostsupdater和vagrant plugin ins
我在理解他们网站上的 vagrant 工作流程时遇到了一些麻烦。 我之前一直在做一个项目,经历了更改目录和设置 vagrant box 等的整个过程。我什至运行了 bundle install 来安装
我在一个盒子上有一些相当复杂的配置,之后我想以编程方式做等效于 vagrant reload 的事情。 . 我见过的最好的解决方案是 here ,但是该链接上的代码似乎在 Vagrant 1.4+ 上
我无法在 Windows 7 机器上在我们的公司代理后面执行 vagrant up(或 vagrant add)。我尝试过使用和不使用 http_proxy/https_proxy 环境变量。我尝试将
是否可以将配置脚本中的值返回给 vagrant? response = config.vm.provision( "shell", path: "script.sh" ) if response =
这两个 Vagrant 插件有什么区别?我正在使用 vagrant-hostmanager,它可以更新主机上的/etc/hosts 文件,以及 guest 机器上的文件,支持多机 vagrant 设置
我正在使用vagrant和ansible来配置虚拟机,并且工作正常。这个可笑的剧本克隆了一个git repo,安装了它并运行了一个服务守护进程。 我还希望有一个无所事事的命令,该命令执行一个单独的“更
在浏览 Vagrant 教程时,我看到了两种在主机和 guest 计算机之间共享文件夹的选项 - 共享文件夹和同步文件夹。它们之间有什么区别? 或者,在 Vagrant 2 中,同步文件夹是共享文件夹
我在 Vagrant 中遇到同步文件夹的问题。我的配置非常简单: Vagrant.configure(2) do |config| config.vm.box = "ubuntu/xenial64
我正在尝试提供一个主-主MySQL对,并且只有它们都启动时才能正确配置它们。 Vagrant.configure("2") do |config| web.vm.box = "centos/7"
我已经在目录D:\vagrant\precise32\02-lamp\中执行了以下命令(在Windows中,使用Git Bash) $ vagrant box add precise32 http:/
尝试使用 Vagrant 的安装程序在 Windows 7 X64 上安装 Vagrant - vagrant_1.7.0.msi 安装正常,但无法使用 vagrant。在任何命令上,例如 vagra
我想禁用VirtualBox Guest Additions。我不会将它们用于文件夹同步等操作,对于我正在使用的盒子(例如centos / 7),无论如何它们都无法构建。有什么办法告诉流浪汉不要尝试在
我在 VirtualBox 上使用 Vagrant。昨天,我通过运行保存了我的项目的快照: $ vagrant snapshot save 'my-project-date-time' 今天,我对我想
我使用来自 vagrant init 的默认配置配置了 Vagrant (1.7.4)在 OS X (10.11.4) 上使用最新版本的 VirtualBox (5.0.16 r105871) 和最新
我是一名优秀的程序员,十分优秀!